intersection算子耗时问题

在Halcon中,我们通常认为算子

intersection(Region1, Region2 : RegionIntersection : : ) 

中的Region1和Region2是不分先后的。大部分情况下他们确实不用分先后顺序,因为大部分情况下,输入的两个区域都各包含一个区域,此时无论两个区域谁是先谁是后,出来的结果都是一样的。 

但根据Halcon的解释:

intersection calculates the intersection of the regions inRegion1 with the regions in Region2. Each region in Region1 is intersected with all regions in Region2. That is, internally all regions of Region2 are united to a single region before the individual regions of Region1 are intersected with the united region. The order of regions in RegionIntersection is identical to the order of regions in Region1.

我们知道,如果Region1和Region2分别包含多个区域时,出来的结果会不尽相同。算则内部会把Region2内所有的区域union1一下,然后将Region1中的区域逐个和union1之后的区域取交集。

但本文不是关注这种区别。而是这个算子的执行时间问题。实际使用时发现:

intersection(RegionBig, RegionSmall, RegionIntersection)
intersection(RegionSmall, RegionBig, RegionIntersection)

即一个区域非常大,一个区域非常小时,求其交集时两个区域放置的先后顺序不同,算子的执行时间有很大差距。把大的区域放到前边会非常省时,反之则非常耗时。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值