2010-11-19 3 views
0

J'ai le code comme:Comment rejoindre 3 open cv IplImages en un?

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 

Comment rejoindre bluechannel, greenchannel et redchannel de nouveau dans une IplImage * destination?

Répondre

2

void cvMerge (const CvArr * src0, const CvArr * src1, const CvArr * src2, const CvArr * src3, CvArr * dst);

Here is the documentation.

Edit:

De la documentation: Vous devrez appeler:

cvMerge(bluechannel, greenchannel, redchannel, NULL, target); 

En supposant que votre image cible a aussi seulement 3 canaux.

+0

hm .. comment obtenir 4 images si j'en ai 3? – Rella

+0

comment créer une telle cible? pourquoi IplImage * destination = cvCreateImage (cvSize (w, h), IPL_DEPTH_8U, 3); fonctionne incorrectement? – Rella

+0

"fonctionne mal" est très peu spécifique, que voulez-vous dire par là? – bjoernz