首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Halcon区域对称性

Halcon区域对称性
EN

Stack Overflow用户
提问于 2020-08-25 08:50:19
回答 1查看 167关注 0票数 0

是否有一种方法来检测一个区域在其垂直中轴线上是否对称?

我有这个地区:

左边是对的,右边是这个洞。我需要探测到它,我想用对称的方法来做它。我在区域特征中找不到任何对称特征.

这是怎么做到的呢?

编辑:

Idea 1:

找到那个人。X和max。X的外部矩形,并计算X平均值。然后运行area_center,找到质量中心,并比较这两个位置。它应该适用于像图像中的例子,如果变形不移动质量中心,它就会失败。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-25 12:42:37

尝试:

代码语言:javascript
复制
* 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, RegionMirror, RegionEnvelope)

* find the difference between the merged region and the original region
difference (RegionEnvelope, Region, RegionDifference)

蓝色区域是RegionDifference

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63575260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档