所以我的代码如下:
IplImage* redchannel = cvCreateImage(cvGetSize(destination), 8, 1);
IplImage* greenchannel = cvCreateImage(cvGetSize(destination), 8, 1);
IplImage* bluechannel = cvCreateImage(cvGetSize(destination), 8, 1);
cvSplit(source, bluechannel, greenchannel, redchannel, NULL);
// code...
//now I need to join them back
如何将bluechannel,greenchannel和redchannel加入一些IplImage *目的地?
答案 0 :(得分:2)
void cvMerge(const CvArr * src0,const CvArr * src1,const CvArr * src2,const CvArr * src3,CvArr * dst);
修改强>
从文档中: 你必须打电话:
cvMerge(bluechannel, greenchannel, redchannel, NULL, target);
假设您的目标图片也只有3个频道。