Here src
is an instance of Mat and it's type is CV_8UC4
.I want to use src
as first parameter of watershed
:
public static void watershed(Mat image, Mat markers)
In about first parameter of watershed
,Docs say:
Parameters:
image - Input 8-bit 3-channel image.
So I have to convert src
from CV_8UC4
to CV_8UC3
.I used this to convert src
type:
src.convertTo(src, CvType.CV_8UC3);
But after that,when I debug code,type of src
is CV_8UC4
yet and no CV_8UC3
.Did I do any thing wrong?And how I can convert it's type?