back to iatexture

Function normmax normalization


The normmax function performs a multiplicative pre-processing method to fix the same range of gray levels for all the images (SAME MAX).

  • g = normmax(f,MAXIMUM)
    • Output
      • g: output image
    • Input
      • f: ndarray: input image.
      • MAXIMUM: cte; highest maximum value for all analyzed images


The normmax function performs a normalization method to apply the same max for all the images by multiplying each gray level by the ratio MAXIMUM/(maximum of the current image). The value of MAXIMUM is the highest max value for all analyzed images.

It is considered here that the variation in image intensity was only multiplicative as observed for example when changing the receiver gain value. Thus we applied a multiplicative transformation to fix the same range of gray levels for all the images of a single protocol using two different schemes.

This normalization preserve the relative variation between two gray levels because it is purely multiplicative

Function Code

1. import numpy as np
3. def normmax(f,MAXIMUM):
4.     aux = f.max()
5.     return f*(1.0*MAXIMUM/aux)


01. import ia636
02. from normmax import normmax
04. f = adreadgray('p/LesionMRI/EM/Iani Surian Batalini - 746587-5 - 32A/22.png')
05. roi = adreadgray('p/LesionMRI/EM/Iani Surian Batalini - 746587-5 - 32A/Peri_22_1.png')>0
06. adshow(f, 'original image')
07. print 'f.max:',f.max()
09. result = normmax(f,MAXIMUM=255)
10. adshow(ia636.ianormalize(result),'norm max result')
11. print 'result.max:',result.max()
f.max: 254
result.max: 255.0

original image

norm max result