convert single channel to 3 channel
why cant i convert a single channel mat to a 3 channel mat using convertTo ?
why cant i convert a single channel mat to a 3 channel mat using convertTo ?
Hi, as given in the document of opencv, convertTo converts an array to another data type with optional scaling. And it is clearly mentioned that the number of channels of output and input must be same. rtype – desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.
use cvtColor(src,dst,COLOR_GRAY2BGR)
Asked: 2017-01-26 22:58:06 -0600
Seen: 14,879 times
Last updated: Jan 27 '17
overflow avoidance on multi-frame accumulation
Convert Mat to MatOfByte in Android
how to sum a 3 channel matrix to a one channel matrix?
Android: Mat converting to CV_8U
cannot convert ‘cv::Mat’ to ‘float’
No way to convert from YUV420sp to RGB565 with OpenCV?
Convert old haarcascade file to new cascade classifier format
convertPointsToHomogeneous doesn't work with double