0

从图像中获取轮廓后,我想将其中的区域分成外围和中心部分。必须根据外围和整体区域之间的固定百分比阈值进行分割。我想到的一个解决方案是计算 minEnclosureCircle ,然后错误地计算点到 countour 中心的距离与圆的半径之间的比率。还有其他想法吗?

4

1 回答 1

0

您正在寻找的是侵蚀和扩张

http://opencv.itseez.com/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.html

腐蚀或膨胀并从原始结果中减去结果。从中您可以计算百分比阈值。

编辑:刚刚看到pointPolygonTest http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=pointpolygon#pointpolygontest

似乎是更好的方法。

于 2012-07-09T09:57:27.957 回答