MATLAB: How to make image intensity equalization for multiple images.

digital image processingimageimage analysisimage processingImage Processing Toolboxintensity

Given: I have 9 gray-scale images of the same size with slightly different intensity.
Want: I want to make uniform intensity for all the images.
Currently done: Just now I'm doing image adjustment followed be image equalization for each single image, by using code below
for x=1:9
eq_image(:,:,x)=histeq(imadjust(some_image(:,:,x)));
figure(x); imshow(eq_image(:,:,x), []);
end
Needed: How to make intensity the same for all 9 images?
[ACKNOWLEDGMENTS]
Thank you for help: Kerem tezcan, Image Analyst

Best Answer

Hey,
When you do histogram equalization, you do that separately for each image, which is not what you want, as you have also stated.
You can normalize the images to one of them. For example choose the first image as the reference, and then calculate the mean intensities of all the images, and find the scaling between each image with the reference image by the formula: sc(n) = mean_of_ref / mean_of_ims(n). Then you can multiply all the images with the corresponding individualized scaling and you will have the same mean intensity for all the images.
Other approaches would be to normalize them according to their maximum values, or similarly to the minimum values, or to the median values.
For the scaling according to the mean of the first image, the code would look like this:
for x=1:9
mns(x) = mean2(some_image(:, :, x));
scaled_image(:, :, x) = some_image(:, :, x) * (mns(1) / mns(x));
end
You can do the histogram equalization independently of the scaling, but doing that afterwards will change the mean of any image you do it to.
Related Question