How to normalize an image to zero mean and unit variance

4,558 views
Skip to first unread message

lijing

unread,
Sep 20, 2008, 9:30:57 AM9/20/08
to Face Recognition Research Community
Good everyone,
I am working on face recognition. I need your help on how to normalize
an image to zero mean and unit variance in MATLAB. In addition, I will
also appreciate simple explanation on it.

Thank you very much.

Lijing

hulijo

unread,
Sep 21, 2008, 3:26:41 PM9/21/08
to Face Recognition Research Community
Zero mean and unit variance normalization is quite simple, you just
remove the mean intensitiy value from an image and then scale it with
its variance. Lets say you have a face image in X, then you just do
the following:

mean_val = mean(X(:));
varian_val = var(X(:));
normalized_X = (X-mean_val)/varian_val;


In the variable normalized_X you have the zero mean and unit variance
normalized face image.

Regards,

Vito

lijing

unread,
Sep 21, 2008, 11:43:24 PM9/21/08
to Face Recognition Research Community
In an image, some pixels' value are bigger than mean value of all the
pixels ,so X-mean_val has some negative value ,how to deal with it ?
when let them to be zero,the real mean value is not zero? Thank you
for your patient explanation!

hulijo

unread,
Sep 22, 2008, 5:04:27 AM9/22/08
to Face Recognition Research Community
Hi again,
yes of course some pixels have negative values. You don't have to deal
with that, you just use the norma
lized face image as a pattern vector for your feature extractor. When
you use zero mean and unit variance normalization, you transform the
pixel intensity distribution from the original one to a standard
normal one (sometimes denoted as N(0,1)). The normalization is
neccessery to account for the illumination conditions present during
the image acquisition process. If you imagine two images of the same
face captured at two different illumination conditions, the faces
could be represented with diffeerent intensity values, you first
remove the mean value to center the image arround the intensity value
0 and then scale the result with its variance to normalize the
"spread" of the intensities of all pixels to one. A visual example of
the normalization can be found in the following report on page 43:
http://luks.fe.uni-lj.si/sl/osebje/vitomir/pub/seminar.pdf

Just ignore the text, because it is in slovene.

Regards,

Vito
Reply all
Reply to author
Forward
0 new messages