O'Reilly logo

Learning Image Processing with OpenCV by Gloria Bueno García, Oscar Deniz Suarez, José Luis Espinosa Aranda, Jesus Salido Tercero, Ismael Serrano Gracia, Noelia Vállez Enano

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

Decolorization

Decolorization is the process of converting a color image to grayscale. Given this definition, the reader may well ask, don't we already have grayscale conversion? Yes, grayscale conversion is a basic routine in OpenCV and any image-processing library. The standard conversion is based on a linear combination of the R, G, and B channels. The problem is that such a conversion may produce images in which contrast in the original image is lost. The reason is that two different colors (which are perceived as contrasts in the original image) may end up being mapped to the same grayscale value. Consider the conversion of two colors, A and B, to grayscale. Let's suppose that B is a variation of A in the R and G channels:

A = (R,G,B) => G ...

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