

We can change the color space of an image using the cvtColor() function of OpenCV.įor example, let’s find the histogram equalization of a colored image.

After that, we can convert the image back to the original color space. To get the desired result, we have to replace the brightness value channel with the output from the equalizeHist() function. We have to convert the image to another color space in which there is a separate channel for the brightness value like HSV, YCbCr, and YUV.Īfter changing the image’s color space, we can pass the channel which contains the brightness value inside the equalizeHist() function to find the histogram equalization of the given image. of 0 will return a pitch-black image How to adjust Brightness, Contrast. So we cannot directly pass the colored image inside the equalizeHist() function to find the histogram equalization of the image. Finding the Brightest Spot in an Image using OpenCV python opencv brightn image.

Histogram equalization will make the bright areas brighter and the dark areas darker.Ī grayscale image only contains the brightness value so that we can pass it directly in the equalizeHist() function to find the histogram equalization of the image.Ī color image is mostly in RGB color space, representing the intensity value of red, green, and blue colors instead of brightness value. Histogram equalization is used to increase the intensity level or contrast of images. Use equalizeHist() Function of OpenCV to Find the Histogram Equalization of Colored Images This tutorial will discuss finding the histogram equalization of a colored image using the equalizeHist() function of OpenCV.
