如何解决Halcon-区域对称
有没有办法检测一个区域在其垂直中心轴上是否对称?
我有这个区域:
左边是正确的,右边有这个孔。我需要检测它,并且想对称地做。我在区域特征中找不到任何对称特征...
这怎么办?
编辑:
想法1:
查找分钟。 X和最大值X为外部矩形,并计算X均值。
然后运行area_center
以找到质心并比较两个位置。它应该与示例中的示例一样工作,并且如果变形不移动质心,则示例将失败。
解决方法
尝试:
* find the center
smallest_rectangle1 (Region,Row1,Column1,Row2,Column2)
* mirror the region
mirror_region (Region,RegionMirror,'column',Column2+Column1+1)
* merge the original region and the mirror region
union2 (Region,RegionEnvelope)
* find the difference between the merged region and the original region
difference (RegionEnvelope,Region,RegionDifference)
蓝色区域是RegionDifference
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。