![]() |
VOOZH | about |
CLAHE (Contrast Limited Adaptive Histogram Equalization) is used to improve the contrast of images. In traditional methods, contrast of whole image changes but CLAHE works by dividing the image into smaller parts and adjust the contrast in each part separately. This helps in avoiding the image getting too bright or too dark in some areas. In this article, we’ll see how to use CLAHE in Python with OpenCV.
When applying CLAHE, there are two parameters to remember:
We process each tile using adaptive histogram equalization, which adjusts pixel intensities based on the local distribution of pixel values. After processing the tiles, it combines them using bilinear interpolation to remove visible boundaries between the tiles. This step ensures that the transition between adjacent tiles is consistent and preserves the natural look of the image while enhancing contrast in local areas.
Now lets see implement this using python.
Input image:
Output:
We can see that by using CLAHE our image got much better and readable compared to ordinary thresholding. This technique is also used in medical images and satellite photos.