color.rst 4.49 KB

Color space processing

cuda::cvtColor

Converts an image from one color space to another.

3-channel color spaces (like HSV, XYZ, and so on) can be stored in a 4-channel image for better performance.

cuda::demosaicing

Converts an image from Bayer pattern to RGB or grayscale.

The function can do the following transformations:

  • Demosaicing using bilinear interpolation

    • COLOR_BayerBG2GRAY , COLOR_BayerGB2GRAY , COLOR_BayerRG2GRAY , COLOR_BayerGR2GRAY
    • COLOR_BayerBG2BGR , COLOR_BayerGB2BGR , COLOR_BayerRG2BGR , COLOR_BayerGR2BGR
  • Demosaicing using Malvar-He-Cutler algorithm ([MHT2011])

    • COLOR_BayerBG2GRAY_MHT , COLOR_BayerGB2GRAY_MHT , COLOR_BayerRG2GRAY_MHT , COLOR_BayerGR2GRAY_MHT
    • COLOR_BayerBG2BGR_MHT , COLOR_BayerGB2BGR_MHT , COLOR_BayerRG2BGR_MHT , COLOR_BayerGR2BGR_MHT

cuda::swapChannels

Exchanges the color channels of an image in-place.

The methods support arbitrary permutations of the original channels, including replication.

cuda::gammaCorrection

Routines for correcting image color gamma.

cuda::alphaComp

Composites two images using alpha opacity values contained in each image.

Note

  • An example demonstrating the use of alphaComp can be found at opencv_source_code/samples/gpu/alpha_comp.cpp
[MHT2011] Pascal Getreuer, Malvar-He-Cutler Linear Image Demosaicking, Image Processing On Line, 2011