Images and Histogram Equalization in Python
Many image processing algorithms use an image histogram. An image is basically a two-dimensional array of numerical intensities. We can compute an image histogram by counting the occurences of distinct pixel intensities over all the pixels in the image.
Histogram equalization is an image processing procedure that reassigns image pixel intensities. The basic idea is to spread out the pixel intensities of the image using a CDF. In many cases, this will give the image a sharper, contrast-enhanced image.
This is particularly useful in astronomy and medical imaging to help us see more features.
In this example (DataCamp), I took an original image (see below) and then calculated its pixel intensity with histogram. I then spread out the distribution of the pixel intensities and then used this to generate a new image (Equalized Image -see below) using the old image.
Image grayscale image of Hawkes Bay, New Zealand(originally by Phillip Capper, modified by User:Konstable, via Wikimedia Commons, CC BY 2.0)
Comments
Post a Comment