2

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

        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;
4

0 回答 0