Function:ChannelSplit

From CUVI Wiki

Splits a three channel image into R, G and B channels

Function

CuviStatus channelSplit(const CuviImage& src,
                        CuviImage& red,
                        CuviImage& green,
                        CuviImage& blue,
                        const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& 3-channel input Image
red CuviImage& Output red channel image
green CuviImage& Output green channel image
blue CuviImage& Output blue channel image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 8uC1 x 3
16uC3 16uC1 x 3
32fC3 32fC1 x 3

Sample

Error creating thumbnail: Unable to save thumbnail to destination
Input Image


Error creating thumbnail: Unable to save thumbnail to destination
Red Channel


Error creating thumbnail: Unable to save thumbnail to destination
Green Channel


Error creating thumbnail: Unable to save thumbnail to destination
Blue Channel


Example

//A single color image
CuviImage gimg = cuvi::io::loadImage(path,CUVI_LOAD_IMAGE_COLOR);

//Three single channel images for storing output
CuviImage gr, gg, gb;

//Split into R, G and B channels
CuviStatus st = cuvi::colorOperations::channelSplit(gimg,gr,gg,gb);