From CUVI Wiki
Jump to: navigation, search

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


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


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


Input Image
Red Channel
Green Channel
Blue Channel


//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);