close_edges2 ( Edges, Gradient : ClosedEdges : MinAmplitude, MaxExtension : )

Close edge gaps using the edge amplitude image.

close_edges1 closes gaps in the output of an edge detector, and thus tries to produce complete object contours. This operator expects as input the edges (Edges) and amplitude image (Gradient) returned by typical edge operators, such as edges__ or sobel_amp.

Contours are closed in two steps: First, one pixel wide gaps in the input contours areclosed, and isolated points are eliminated. After this, open contours are extended by up to MaxExtension points by adding edge points until either the contour is closed or no more significant edge points can be found. A gradient is regarded as significant if it is larger than MinAmplitude. The neighboring points examined as possible new edge points are the point in the direction of the contour and its two adjacent points in an 8-neighborhood. For each of these points, the sum of its gradient and the maximum gradient of that points three possible neighbors is calculated (look ahead of length 1). The point with the maximum sum is then chosen as the new edge point.


Attention

In the current implementation MinAmplitude is ignored; any gradient value larger than zero is regarded as significant.


Parameters

Edges (input_object)
region(-array) -> object
Region containing one pixel thick edges.

Gradient (input_object)
image -> object : byte
Edge amplitude (gradient) image.

ClosedEdges (output_object)
region(-array) -> object
Region containing closed edges.

MinAmplitude (input_control)
integer -> integer
Minimum edge amplitude.
Default value: 16
Suggested values: 5, 8, 10, 12, 16, 20, 25, 30, 40, 50
Range of values: 1 <= MinAmplitude <= 255
Minimum increment: 1
Recommended increment: 1
Restriction: MinAmplitude >= 0

MaxExtension (input_control)
integer -> integer
Maximal number of points by which edges are extended.
Default value: 3
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20
Range of values: 1 <= MaxExtension <= 50
Minimum increment: 1
Recommended increment: 1
Restriction: MaxExtension > 0


Example
sobel_amp(Image,&EdgeAmp,"sum_abs",5);
threshold__(EdgeAmp,&EdgeRegion,40.0,255.0);
skeleton(EdgeRegion,&ThinEdge);
close_edge2(ThinEdge,EdgeAmp,&CloseEdges,15,3);

Result

close_edges2 returns TRUE if all parameters are correct. If the input is empty the behaviour can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.


Possible Predecessors

edges__, sobel_amp, threshold__, skeleton


Alternatives

close_edges1, dilation1, closing


References

M.Usbeck: ``Untersuchungen zur echtzeitfahigen Segmentierung''; Studienarbeit, Bayerisches Forschungszentrum fur Wissensbasierte Systeme (FORWISS), Erlangen, 1993.



Copyright © 1996-1997 MVTec Software GmbH