close_edges — Close edge gaps using the edge amplitude image.
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
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
Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.
Region containing one pixel thick edges.
→object (byte / uint2 / int4)
Edge amplitude (gradient) image.
Region containing closed edges.
Minimum edge amplitude.
Default value: 16
Suggested values: 5, 8, 10, 12, 16, 20, 25, 30, 40, 50
Typical range of values:
Minimum increment: 1
Recommended increment: 1
MinAmplitude >= 0
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 returns 2 (H_MSG_TRUE) if all parameters are
correct. If the input is empty the behavior can be set via
necessary, an exception is raised.