Hi there! Im using openCV C++
Im need to convert a single channel image to 3 channels image. So i can use this: cvCvtColor(result,gray,CV_BGR2GRAY);
I cannot do that because the result img is a single channel image. Any ideas?
Hi there! Im using openCV C++
Im need to convert a single channel image to 3 channels image. So i can use this: cvCvtColor(result,gray,CV_BGR2GRAY);
I cannot do that because the result img is a single channel image. Any ideas?
Try this
CvSize dim = cvSize(int width, int height);
IplImage* dst = cvCreateImage( dim, 8, 3 );\
IplImage* gray = cvCreateImage(dim, , 8 , 1);
// Load the gray scale image
cvMerge(gray , NULL, NULL, NULL, dst);
cvShowImage("gray",gray);
cvShowImage("dst",dst);
cvWaitKey(0);
Both dst and gray must have their data types same. You cant simply merge a float in a uint matrix. You will have to use cvScale for that.