【问题标题】:Halcon - verify if region is emptyHalcon - 验证区域是否为空
【发布时间】:2021-02-02 21:53:43
【问题描述】:

这一行:

intersection(CurrentZplaneTransRegion, Unshifted, CurrentRegion)

有时会返回一个空区域。我需要抓住这种情况。如何验证currentRegion 是否为空?

【问题讨论】:

    标签: region is-empty halcon


    【解决方案1】:

    有两种可能性。

    第一:

    area_center (CurrentRegion, AreaCurrentRegion, _, _)
    if (AreaCurrentRegion==0)
        * CurrentRegion is empty
    else
        * CurrentRegion is not empty
    endif
    

    第二:

    gen_empty_region (EmptyRegion)
    if (CurrentRegion==EmptyRegion)
        * CurrentRegionn is empty
    else
        * CurrentRegion is not empty
    endif
    

    【讨论】:

      【解决方案2】:

      您可以为此使用运算符area_center(CurrentRegion, Area, Row, Column) 并检查Area 结果是否为零。

      【讨论】:

        猜你喜欢
        • 2020-12-13
        • 2020-10-28
        • 2021-01-29
        • 2020-12-23
        • 2020-03-30
        • 2022-01-14
        • 1970-01-01
        • 2021-09-22
        • 2021-01-29
        相关资源
        最近更新 更多