Normalization of Thermal image with range 0 to 40

973 Views Asked by At

I'm doing research about using thermal image for temperature measurement for medical purposes, I try to repeat methodology of paper "Face and eyes localization algorithm in thermal images for temperature measurement of the inner canthus of the eyes". They used Normalization of thermal image with range 0 to 40, and they got this results.

enter image description here

I tried the code below:

tt = imread('test.jpg');
figure, imshow(tt)
tt = double(tt);
normimg = uint8(zeros(size(tt))); 
for idx = 1 : 3
chan = tt(:,:,idx);
minvalue = min(chan(:));
maxvalue = max(chan(:));
normimg(:,:,idx) = uint8((chan-minvalue)*40/(maxvalue-minvalue)); 
end
figure, imshow(normimg)

and I got different results so what I should do to get same results Thank you in advance

enter image description here

2

There are 2 best solutions below

3
On

You should first try to convert it to 2d matrix (Grayscale) then normalize it by the 40*(X-Min)/(Max-Min)

0
On

Your normalization is OK and the image is fine. The point is that "imshow" command assumes your image is in range [0~255] so if the maximum value of the image is 40, it will be dark in the figure. To see the image properly, put a "[]" in imshow command:

imshow(normimg,[])

And also you can do the whole job in just three lines:

tt = imread('test.jpg');
normimg = 40 * mat2gray(tt);
figure, imshow(normimg,[]);