Q:

How to join 3 open cv IplImages into one?

So I have code like:
    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

How to join  bluechannel, greenchannel and redchannel back into some    IplImage* destination ?

A:

void cvMerge(const CvArr* src0, const CvArr* src1, const CvArr* src2, const CvArr* src3, CvArr* dst);
Here is the documentation.
Edit:
From the documentation:
You will have to call:
cvMerge(bluechannel, greenchannel, redchannel, NULL, target);

Assuming that your target image also has only 3 channels.

