Color space processing
cuda::cvtColor
Converts an image from one color space to another.
-
C++: void cuda::cvtColor(InputArray src, OutputArray dst, int code, int dcn=0, Stream& stream=Stream::Null())
Parameters: |
- src – Source image with CV_8U , CV_16U , or CV_32F depth and 1, 3, or 4 channels.
- dst – Destination image.
- code – Color space conversion code. For details, see cvtColor() .
- dcn – Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from src and the code .
- stream – Stream for the asynchronous version.
|
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.
-
C++: void cuda::demosaicing(InputArray src, OutputArray dst, int code, int dcn=-1, Stream& stream=Stream::Null())
Parameters: |
- src – Source image (8-bit or 16-bit single channel).
- dst – Destination image.
- code – Color space conversion code (see the description below).
- dcn – Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from src and the code .
- stream – Stream for the asynchronous version.
|
The function can do the following transformations:
cuda::swapChannels
Exchanges the color channels of an image in-place.
-
C++: void cuda::swapChannels(InputOutputArray image, const int dstOrder[4], Stream& stream=Stream::Null())
Parameters: |
- image – Source image. Supports only CV_8UC4 type.
- dstOrder – Integer array describing how channel values are permutated. The n-th entry of the array contains the number of the channel that is stored in the n-th channel of the output image. E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR channel order.
- stream – Stream for the asynchronous version.
|
The methods support arbitrary permutations of the original channels, including replication.
cuda::gammaCorrection
Routines for correcting image color gamma.
-
C++: void cuda::gammaCorrection(InputArray src, OutputArray dst, bool forward=true, Stream& stream=Stream::Null())
Parameters: |
- src – Source image (3- or 4-channel 8 bit).
- dst – Destination image.
- forward – true for forward gamma correction or false for inverse gamma correction.
- stream – Stream for the asynchronous version.
|
cuda::alphaComp
Composites two images using alpha opacity values contained in each image.
-
C++: void cuda::alphaComp(InputArray img1, InputArray img2, OutputArray dst, int alpha_op, Stream& stream=Stream::Null())
-
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 |
Help and Feedback
You did not find what you were looking for?
- Ask a question on the Q&A forum.
- If you think something is missing or wrong in the documentation,
please file a bug report.