[Feature Request] Contrast Limited Adaptive Histogram Equalization (CLAHE)

The adaptive part of CLAHE (contrast-limited adaptive histogram equalisation) is generally implemented as a coarse adaptation, eg blending the results from a 2x2 array of tiles, or 6x6 or whatever. That’s what I describe in [Adaptive] Contrast-limited equalisation. This gives a result where the effect varies smoothly across an image. This is often desirable, of course.

However, sometimes we want a very localised adaptation, to get little equalisation in smooth areas (eg skin) and more in high-contrast areas (eg eyelashes).

CLAHE is not well-suited when we have many tiles, eg 10x10 or more because the histogram has to be calculated for each tile so it is slow. In addition, if the tile size is small, each tile has too few pixels for a histogram to be meaningful.

At the other extreme, Maximise local contrast operates at fine granularity, eg a tile size of 3x3 pixels, so it is highly responsive to changing conditions and can easily be masked to have strong effect in high-contrast areas and little or no effect in low-contrast areas.

Horses for courses, and all that.

2 Likes