【问题标题】:Halcon - Region SymmetryHalcon - 区域对称
【发布时间】:2020-12-13 22:23:54
【问题描述】:

有没有办法检测一个区域在其垂直中心轴上是否对称?

我有这个区域:

左边是正确的,右边有这个洞。我需要检测它,想对称做。我无法在区域特征中找到任何对称特征...

这是怎么做到的?

编辑:

想法 1:

找到最小值。 X 和最大。外矩形的 X,并计算 X 均值。 然后运行area_center 找到质心并比较两个位置。它应该适用于图像中的示例,如果变形不移动质心,它将失败..

【问题讨论】:

    标签: region halcon symmetry


    【解决方案1】:

    试试:

    * 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

    【讨论】:

      猜你喜欢
      • 2020-10-28
      • 2021-01-29
      • 2020-12-23
      • 2020-03-30
      • 2021-02-02
      • 2021-01-29
      • 2020-11-18
      • 2021-03-09
      • 2020-09-22
      相关资源
      最近更新 更多