O'Reilly logo

OpenCV Essentials by Jesus Salido Tercero, Julio Alberto Patón Incertis, Ismael Serrano Gracia, Gloria Bueno García, Noelia Vállez Enano, Mª del Milagro Fernández Carrobles, Oscar Deniz Suarez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Histogram matching and LUT

The histogram may also be used to modify the color of an image. Histogram matching is a method of color adjustment between two color images. Given a reference image and a target image, the result (destination image) will be equal to the target image except that its (three) histograms will look like those of the reference image. This effect is known as color mapping or color transfer.

The histogram matching algorithm is run over each of the three color histograms independently. For each channel, the cumulative distribution function (cdf) has to be calculated. For a given channel, let Fr be the cdf of the reference image and Ft be the cdf of the target image. Then, for each pixel v in the reference image, we find the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required