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?
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?
You can create a vector of the same channel, then merge them, like as follows:
std::vector<cv::Mat> copies{mat,mat,mat};
cv::merge(copies,mat);