OPENCV Adaptive histogram equalization with Python for constrained contrast

Source: Internet
Author: User

the first approach to the adaptive histogram equalization is to divide the image into non-overlapping area blocks, and then make the histogram equalization for each block separately. If the image is noisy, the noise will be amplified in the block of each segmented small area.

To avoid the effect of noise on image equalization, the adaptive Histogram equalization with limited contrast is used to deal with the histogram equalization of images.

The histogram equalization of the limit contrast is handled by setting a threshold for the histogram, which is the limit contrast value, the value that exceeds the threshold is clipped, and then the cropped portion is evenly distributed across the other values, so that the histogram is reconstructed, and then the reconstructed histogram can be used for the next equalization operation.

Here is an example diagram of how to limit contrast, and I'll use an Excel graph to show it here:

At a threshold of 40 o'clock, the histogram area, which exceeds the threshold of 50, distributes the portions of the extra 50-40=10 evenly across each region, with an average value of 2 per region added.

Note: The adaptive histogram equalization function that restricts contrast is not mentioned in the OpenCV manual.

The specific Python implementation of the Adaptive Histogram equalization code for limiting contrast is as follows:

where the default setting is 40, the size of the block is 8x8

The effect of the program after running is as follows:

This digest from the asynchronous community, night Pathfinder, works:" OpenCV using Python to achieve adaptive histogram equalization with limited contrast ", without authorization, No reprint.


Recommended Reading

May 2018 new book list (end of text benefits)

April 2018 new book list

The most complete Python book for asynchronous books

A programmer's list of algorithmic books

The first Python neural network programming book





Long Press Two-dimensional code, you can follow us yo

Share it good text with you every day.


in the"Asynchronous Books"Background reply"concern",can be obtained free of charge2000-Door online video Course

Click to view the original text and read more

Read the original


OPENCV Adaptive histogram equalization with Python for constrained contrast

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.