Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的编码中创建一个掩码,我有一个 Rect 和一个输入图像,那么如何初始化掩码。
掩码通常是 CV_8U Mat。
这对我有用:
Mat mask = new Mat(src.size(), CvType.CV_8U, new Scalar(0)); // This will contain the mask Imgproc.rectangle(mask, point1, point2, new Scalar(1), Core.FILLED); // Draw on the mask
我希望它可以帮助你:)