Contrast Limited Adaptive Histogram Equalization (CLAHE) redistribution of excess pixels

9 views (last 30 days)
Hi
I'm having troubles understanding how the pixels are redistributed when using the CLAHE on images.
I have read through the following links:
And as far as I understand, when performing CLAHE, you pick a cliplimit for the histogram, where all the bins higher than the cliplimit is cut off at the limit and the excess pixels are then redistributed evenly among all the other bins. In my case this would then be among all the 256 bins for my grayscale image.
However when using the MATLAB function adapthisteq (or any other CLAHE function that I can find) it seems to me that this is not the case.
Below is the MATLAB code I've used to visualize it. The histogram have been normalized.
im = imread('Underwater1.png');
im = rgb2gray(im);
im2 = adapthisteq(im, 'NumTiles', [2,2], 'ClipLimit', 0.02)
histogram(im, 'Normalization', 'probability')
figure(2)
histogram(im2, 'Normalization', 'probability')
And the histogram figures I get are:
It is here seen that the pixels are not distributed completely evenly among the other bins as there are no pixels in bin 1-17 and no pixels above bin 236. So how are the excess pixels redistributed?
Thank you in advance.

Accepted Answer

Image Analyst
Image Analyst on 21 Dec 2018
That is true, but there are different ways you could decide which pixels to redistribute. Plus with a small window size, there is a change no pixels will be up at the bright end. For example, let's say that after histogram equalization, you had a huge bin at gray level 150. So now, all those post-change pixels with a gray level of 150 will be given new gray levels in the range 0-255. Well what if your window is only 4 pixels, then you might get new gray levels of [14,55, 123, and 190], so none in the bright end. It seems that is not your case since you are dividing your image into quadrants, which, by the way, is usually not fine enough for good histogram equalization. Nonetheless, you can do that, however you still have to look at the post correction histogram. What is probably happening in your case is that you do not have any regions that are uniform. So before correction, and even after correction, there are no bins that are above the clip limit. Or if there are, that the bins above the clip limit are in the 236-255 range and so they get redistributed out of that range.

More Answers (0)

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!