close_edges — 使用边缘振幅图像闭合边缘间隙。
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.”
请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章
Edges (输入对象) region(-array) → object
Region containing one pixel thick edges.
EdgeImage (输入对象) singlechannelimage → object (byte / uint2 / int4)
Edge amplitude (gradient) image.
RegionResult (输出对象) region(-array) → object
Region containing closed edges.
MinAmplitude (输入控制) integer → (integer)
最小边缘振幅。
默认值: 16
建议值: 5, 8, 10, 12, 16, 20, 25, 30, 40, 50
值范围:
1
≤
MinAmplitude
最小增量: 1
建议增量: 1
sobel_amp(Image,&EdgeAmp,"sum_abs",5); threshold(EdgeAmp,&EdgeRegion,40.0,255.0); skeleton(EdgeRegion,&ThinEdge); close_edges(ThinEdge,EdgeAmp,&CloseEdges,15); skeleton(CloseEdges,&ThinCloseEdges);
close_edges 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空则可设置行为通过 set_system('no_object_result',<Result>)。如有必要,则抛出异常。
edges_image,
sobel_amp,
threshold,
skeleton
close_edges_length,
dilation1,
closing
基础