Function:ChannelMix

From CUVI Wiki
Revision as of 15:44, 26 April 2012 by Jawad (talk | contribs)

Function

CuviStatus colorTwist(CuviImage* srcImage,
                      CuviImage* dstImage,
                      Cuvi32f coeffs[9],
                      CuviStream* stream = NULL);


Parameters

Name Type Description
srcImage CuviImage* Input Image
dstImage CuviImage* Output Image
coeffs[9] Cuvi32f Coefficient matrix for channel mixing
stream CuviStream* GPU stream ID for execution


Image Type Support

Input Output
8uC3 8uC3
16uC3 16uC3

Sample

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


Example

CuviImage* gimg = new CuviImage(size,img->depth,img->nChannels);
CuviImage* gout = new CuviImage(size,img->depth,img->nChannels);

gimg->upload(img->imageData,img->widthStep);

//Color-Mix matrix
float* coff = new float[9];
	coff[0]= 1.05f;
	coff[1]= -0.025f;
	coff[2]= -0.025f;
	coff[3]= -0.45f;
	coff[4]= 1.975f;
	coff[5]= -0.525f;
	coff[6]= 0.225f;
	coff[7]= -1.05f;
	coff[8]= 1.825f;

//function call
cuvi::ColorOperations::colorTwist(gimg,gout,coff);