Histogram Equalization (CLAHE) with OpenCV

Normal Histogram Equalization works on the whole image, while CLAHE (Contrast Limited Adaptive Histogram Equalization) works on small regions for better results. It enhances image contrast by stretching the intensity range.

Contrast Limited Adaptive Histogram Equalization (CLAHE) is an advanced version of histogram equalization that improves local contrast in images while limiting noise amplification.

What is CLAHE

CLAHE differs from standard histogram equalization in two key ways:

  1. Adaptive: It operates on small regions of the image (tiles) rather than the entire image
  2. Contrast Limited: It limits contrast amplification to reduce noise in homogeneous regions

When to Use CLAHE

CLAHE is particularly useful for:

  • Medical imaging (X-rays, CT scans)
  • Satellite/aerial imagery
  • Low-contrast images
  • Images with varying illumination conditions

The method helps reveal details in both dark and bright regions of an image while preventing over-amplification of noise.

Here’s how to use CLAHE with OpenCV in Python:

Output

Histogram Equalization with OpenCV

 

Parameters of the createCLAHE() function

  • clipLimit: Threshold for contrast limiting (default 40.0)
  • tileGridSize: Size of the grid for histogram equalization (default 8×8)

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Contour Detection with OpenCV
Perspective Transform Warping with OpenCV
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment