为什么我的drawContours没有作用?
Utils.bitmapToMat(srcBitmap, rgbMat);
Imgproc.cvtColor(rgbMat, grayMat, Imgproc.COLOR_RGB2GRAY);
Imgproc.medianBlur(grayMat,grayMat,17);
Imgproc.Canny(grayMat,grayMat,2,50,3);
Imgproc.adaptiveThreshold(grayMat,grayMat,255,ADAPTIVE_THRESH_MEAN_C,THRESH_BINARY_INV,9,10);
Mat structuringElement = Imgproc.getStructuringElement(MORPH_RECT, new Size(5,5));
Imgproc.dilate(grayMat,grayMat,structuringElement,new Point(1,1),5);
List<MatOfPoint> Contours = new ArrayList<MatOfPoint>();
Mat hierarchy = new Mat();
Imgproc.findContours(grayMat,Contours,hierarchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
Imgproc.drawContours(grayMat,Contours,-1, new Scalar(255,0,255),1,8,hierarchy);
Utils.matToBitmap(grayMat, grayBitmap);
效果只到了膨胀阶段
谢谢!!!