From CUVI Wiki
Jump to: navigation, search

Converts a gray-scale image to 3 or 4 channel image by copying the same input image to all the channels of output image. For a 4 channel output image, the alpha channel is ignored. The resultant image will still be gray (since all channels are of same value) but it will be a 3/4 channel image. For debayer, please refer to demosaicDFPD.


CuviStatus gray2rgb(const CuviImage& src,
                    CuviImage& dst,
                    const CuviStream& stream = CuviStream());
CuviStatus gray2rgb(CuviImage& srcDst,
                    const CuviStream& stream = CuviStream());


Name Type Description
src CuviImage& Input single channel image
dst CuviImage& Output 3-channel image
stream CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 8uC3 or 8uC4
16uC1 16uC3 or 16uC4
32fC1 32fC3 or 32fC4



CuviImage gimg = cuvi::io::loadImage(path, CUVI_LOAD_IMAGE_GRAYSCALE), gout;
//Convert to 3 channel image