halcon边缘检测-close_edges.hev

匿名 (未验证) 提交于 2019-12-02 23:05:13

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)

文章来源: https://blog.csdn.net/qq_29407397/article/details/86501628
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!