Splits a three channel image into R, G and B channels
Function
CuviStatus channelSplit(CuviImage* srcImage,
CuviImage* dstRed,
CuviImage* dstGreen,
CuviImage* dstBlue,
CuviStream* stream = NULL);
|
Parameters
| Name
|
Type
|
Description
|
| src
|
CuviImage*
|
3-channel input Image
|
| dstRed
|
CuviImage*
|
Output red channel image
|
| dstGreen
|
CuviImage*
|
Output green channel image
|
| dstBlue
|
CuviImage*
|
Output blue channel image
|
| stream
|
CuviStream*
|
GPU stream ID for execution
|
Image Type Support
| Input
|
Output
|
| 8uC3
|
8uC1 x 3
|
| 16uC3
|
16uC1 x 3
|
Sample
Input Image
|
Red Channel
|
Green Channel
|
Blue Channel
|
Example
//A single color image
CuviImage *gimg = new CuviImage(_size,img->depth,img->nChannels);
//Three single channel images for storing output
CuviImage *gr = new CuviImage(_size,img->depth,1);
CuviImage *gg = new CuviImage(_size,img->depth,1);
CuviImage *gb = new CuviImage(_size,img->depth,1);
//Populate the GPU image with pixel data
gimg->upload(img->imageData,img->widthStep);
//Split into R, G and B channels
CuviStatus st = cuvi::colorOperations::channelSplit(gimg,gr,gg,gb);
|