** might not suit all version of OPCV.
When you want to convert a 3-channel Mat to single channel,
should use
Imgproc.cvtColor(Mat src, Mat dst, int code) ;
instead of
Mat.convertTo(Mat m, int rtype);
Because the result of Mat.convertTo() will have the same CvType of input mat.
Example:
when trying to convert to single channel, using :
Imgproc.cvtColor(_inputMat, resultMat, Imgproc.COLOR_RGBA2GRAY);
沒有留言:
張貼留言