Herror ::close_edges (
    Hobject Edges,
    Hobject EdgeImage,
    Hobject *RegionResult,
    const HTuple &MinAmplitude
)
HRegion HRegion::CloseEdges (
    const HImage &EdgeImage,
    const HTuple &MinAmplitude
) const
HRegionArray HRegionArray::CloseEdges (
    const HImage &EdgeImage,
    const HTuple &MinAmplitude
) const

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 ::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.''


Parameters

Edges (input_object)
region(-array) -> Hobject: HRegion(Array)
Region containing one pixel thick edges.

EdgeImage (input_object)
image -> Hobject: HImage ( byte )
Edge amplitude (gradient) image.

RegionResult (output_object)
region(-array) -> Hobject * : HRegion(Array)
Region containing closed edges.

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


Example
sobel_amp(Image,&EdgeAmp,"sum_abs",5);
threshold(EdgeAmp,&EdgeRegion,40.0,255.0);
skeleton(EdgeRegion,&ThinEdge);
close_edge1(ThinEdge,EdgeAmp,&CloseEdges,15);
skeleton(CloseEdges,&ThinCloseEdges);

Result

::close_edges returns H_MSG_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 handling is raised.


Possible Predecessors

::edges_image, ::sobel_amp, ::threshold, ::skeleton


Possible Successors

::skeleton


Alternatives

::close_edges_length, ::dilation1, ::closing


See also

::gray_skeleton


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH