android openCV分水岭

时间:2013-07-14 03:37:11

标签: android opencv watershed

我使用此代码从图像中提取中心段,但我的代码不能正常工作并将输入mat作为输出返回

        Imgproc.cvtColor(mRgba, mRgba, Imgproc.COLOR_RGBA2BGR);     
    Marker=new Mat(mRgba.size(),CvType.CV_32S);
    Core.circle(Marker, new Point(mRgba.width()/2,mRgba.height()/2),Math.min(mRgba.width(), mRgba.height()), new Scalar(125,125,125) ,-1);
    Core.circle(Marker, new Point(mRgba.width()/2,mRgba.height()/2),Math.min(mRgba.width()/4, mRgba.height()/4)/4, new Scalar(255,255,255),-1);
    Imgproc.watershed(mRgba , Marker);
    Marker.convertTo(Marker, CvType.CV_8U);

    return Marker;

0 个答案:

没有答案