image = | adaptiveContrastEnhancement2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY,inArithmeticVal,inBlendMultiplier) |
Localy adjust the contrast of an image.
This algorithm computes a new intensity according to its neighbour in order to locally enhance the image contrast.
Each pixel intensity is calculated according to a relative percentage of its neighbourhood intensities. The calculation is comparable to the Contrast Limited Adaptive Histogram Equalization (CLAHE) [1], although it remains much less heavy. Contrary to the CLAHE, it is possible to compute the contrast to each pixel in a reasonable amount of time.
In order to reduce the impact of the noise, a tolerance threshold is used to make the algorithm consider that a neighbour has the same intensity than the current pixel if , where is the coordinate of the current pixel, is the coordinate of its neighbour.
The output intensities may differ a lot from the original images. For this reason, the input image is mixed with the adaptive contrast enhancement result to generate an output looking like the input image. It is possible to tune this effect thanks to the inBlendMultiplier parameter. A blend coefficient of 0 means that the output is the direct result of the enhancement and a blend value of 1 will yield the input image.
Here is an example of an adaptive contrast enhancement operation applied to a grey level image.
kernel size = 15, offset = 15, blend value = 0.5.
[1] Zuiderveld, Karel. "Contrast Limited Adaptive Histograph Equalization." Graphic Gems IV. San Diego: Academic Press Professional, 1994. 474-485.