0
我写过一些代码,它将从实际图像中返回轮廓。我想访问每个轮廓,在像素级进行一些图像处理并写回图像。如何访问轮廓区域内的像素,并使用Android中的opencv回写原始图像
有没有办法单独访问轮廓区域,并遍历区域中的单个像素并写回图像。
Rect rect = Imgproc.boundingRect(matOfPoint);
Mat roiBox = rgbaMatrix.submat(rect)
这将返回一个子矩阵,其中也包含不属于轮廓的像素。
Please follow this link to see the screenshot of contour detections
我认为最简单的方式是通过绘制你的轮廓为白色填充多边形新的黑色图像上创建蒙版。 –