halcon边缘检测-close_edges.hev

close_edges(Edges, EdgeImage : RegionResult : MinAmplitude : )

close_edges closes gaps in the output of an edge detector, and thus tries to produce complete object contours. This is done by examining the neighbors of each edge point to determine the point with maximum amplitude (i.e., maximum gradient), and adding the point to the edge if its amplitude is larger than the minimum amplitude passed in MinAmplitude. This operator expects as input the edges (Edges) and amplitude image (EdgeImage) returned by typical edge operators, such as edges_image or sobel_amp. close_edges does not take into account the edge directions that may be returned by an edge operator. Thus, in areas where the gradient is almost constant the edges may become rather “wiggly.”

close_edges关闭边缘检测器输出中的间隙,从而尝试生成完整的对象轮廓。 这是通过检查每个边缘点的邻居来确定具有最大幅度(即最大梯度)的点,并且如果其幅度大于在MinAmplitude中传递的最小幅度,则将该点添加到边缘。 此运算符期望由典型的边运算符(例如edges_image或sobel_amp)返回的边(Edges)和幅度图(EdgeImage)作为输入。 close_edges不考虑边缘运算符可能返回的边缘方向。 因此,在梯度几乎恒定的区域中,边缘可能变得相当“摇摆”。

read_image (Image, 'fabrik')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowID)
sobel_amp (Image, EdgeAmplitude, 'thin_sum_abs', 3)
threshold (EdgeAmplitude, Edges, 30, 255)
close_edges (Edges, EdgeAmplitude, EdgesExtended, 15)
dev_set_color ('green')
dev_display (EdgesExtended)
dev_set_color ('red')
dev_display (Edges)

下图的红色部分是经过sobel和阈值分割的。绿色部分是经过close_edges得到的。 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘大望

谢谢你请的咖啡

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值