Last week we discussed histogram equalization, a basic image processing technique that can improve the contrast of an input image.

But what if you wanted to match the contrast or color distribution of two images automatically?

For example, suppose we have an input image and a reference image. Our goal is to:

  1. Compute histograms for each image
  2. Take the reference image histogram
  3. Update the pixel intensity values in the input image using the reference histogram, such that they match

We see the result in the figure at the top of this blog post. Notice how the input image is updated to match the color distribution of the reference image.

#python #opencv #histogram matching

Histogram Matching with OpenCV, Scikit-image, and Python
9.20 GEEK