Morphological Quotient Image (MQI) is a method for Illumination Normalization which is proposed in [-1-]:
In Retinex theory [-2-], an image I(x, y) can be modeled as the product of the reflectance function R(x, y) and luminance function L(x, y):
I(x, y) = R(x, y) L(x, y)
The reflectance R(x, y), relating to the characteristics of objects in the scene of the image, is dependent on the albedo of the scene’s surfaces, whereas the luminance L(x, y),
relating to the amount of illumination falling on the observed scene, is determined by the illumination source. Since the reflectance R(x, y) only relates to the objects in the
image, it is obvious that, when successfully estimated, it can be an illumination invariant representation of the input image. Thus, in order to obtain an illumination invariant
image representation, the luminance L(x, y) of an image is commonly estimated first. Then, the reflectance is formulated as the quotient of the image I(x, y) and its luminance L(x,y), as shown below:
R(x, y) = I(x, y) / L(x, y)
In the MQI-based illumination normalization method, the luminance L(x, y) is estimated by applying a morphological close operation, with a fixed size template, to an image I(x,y).
by this method, [-1-] has got this result, but my implementation’s result is: both results
here is my MATLAB function:
function mytest1
for i=1:4
img= imread(strcat(num2str(i),'.bmp'));
cimg= gsClose(img, 7,7);
mqi= histeq(img./cimg);
subplot(2,4,i), imshow(img);
subplot(2,4,4+i), imshow(mqi);
end
end
function img= gsClose(img, x, y)
img= uint8(gsDilation(gsErosion(img,x,y),x,y));
end
function img= gsErosion(img, x, y)
img=ordfilt2(img,1,ones(x,y),-ones(x,y));
end
function img= gsDilation(img, x, y)
img=ordfilt2(img,9,ones(x,y),ones(x,y));
end
i don’t know, where i went wrong! please guide me. i uploaded the images too:
download
[-1-] J. Wang, L. Wu, X. He, and J. Tian. A New Method of Illumination Invariant Face Recognition. In Proc. of International Conference on Innovative Computing, 2007: 139-142
[-2-] E. H. Land, and J. J. McCann. Lightness and Retinex Theory. Journal of Optical Society of America, 61(1): 1-11, 1971.
The implementation was correct. I just took a wrong way to display final images.
I used imshow method in MATLAB:
But i should have used: