back to iatexture

Function normmean normalization

Synopse

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

  • g = normmean(f,MEAN)
    • Output
      • g: output image
    • Input
      • f: ndarray: input image.
      • MEAN: cte; highest mean value for all analyzed images

Description

The normmean function performs a normalization method to apply the same mean for all the images by multiplying each gray level by the ratio MEAN/(mean of the current image). The value of MEAN is the highest mean 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
2. 
3. def normmean(f,MEAN):
4.     aux = f.mean()
5.     return f*(1.0*MEAN/aux)

Example

01. import ia636
02. from normmean import normmean
03. 
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.mean',f.mean()
08. 
09. result = normmean(f,MEAN=100)
10. adshow(ia636.ianormalize(result),'norm mean result')
11. print 'result.mean',result.mean()
f.mean 25.429977417
result.mean 100.0

original image

norm mean result