HALCON Reference Manual 10.0.2
Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators

close_edges_lengthclose_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLength (Operator)

Name

close_edges_lengthclose_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLength — Close edge gaps using the edge amplitude image.

Signature

close_edges_length(Edges, Gradient : ClosedEdges : MinAmplitude, MaxGapLength : )

Herror close_edges_length(const Hobject Edges, const Hobject Gradient, Hobject* ClosedEdges, const Hlong MinAmplitude, const Hlong MaxGapLength)

Herror T_close_edges_length(const Hobject Edges, const Hobject Gradient, Hobject* ClosedEdges, const Htuple MinAmplitude, const Htuple MaxGapLength)

Herror close_edges_length(Hobject Edges, Hobject Gradient, Hobject* ClosedEdges, const HTuple& MinAmplitude, const HTuple& MaxGapLength)

HRegion HRegion::CloseEdgesLength(const HImage& Gradient, const HTuple& MinAmplitude, const HTuple& MaxGapLength) const

HRegionArray HRegionArray::CloseEdgesLength(const HImage& Gradient, const HTuple& MinAmplitude, const HTuple& MaxGapLength) const

void HOperatorSetX.CloseEdgesLength(
[in] IHUntypedObjectX* Edges, [in] IHUntypedObjectX* Gradient, [out] IHUntypedObjectX*ClosedEdges, [in] VARIANT MinAmplitude, [in] VARIANT MaxGapLength)

static void HOperatorSet.CloseEdgesLength(HObject edges, HObject gradient, out HObject closedEdges, HTuple minAmplitude, HTuple maxGapLength)

Description

close_edges_lengthclose_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLength closes gaps in the output of an edge detector, and thus tries to produce complete object contours. This operator expects as input the edges (EdgesEdgesEdgesEdgesedges) and amplitude image (GradientGradientGradientGradientgradient) returned by typical edge operators, such as edges_imageedges_imageedges_imageEdgesImageEdgesImage or sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp.

Contours are closed in two steps: First, one pixel wide gaps in the input contours are closed, and isolated points are eliminated. After this, open contours are extended by up to MaxGapLengthMaxGapLengthMaxGapLengthMaxGapLengthmaxGapLength 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 MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitude. 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.

Parallelization

Parameters

EdgesEdgesEdgesEdgesedges (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Region containing one pixel thick edges.

GradientGradientGradientGradientgradient (input_object)  image objectHImageHImageHImageXHobject (byte / uint2)

Edge amplitude (gradient) image.

ClosedEdgesClosedEdgesClosedEdgesClosedEdgesclosedEdges (output_object)  region(-array) objectHRegionHRegionHRegionXHobject *

Region containing closed edges.

MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitude (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Minimum edge amplitude.

Default value: 16

Suggested values: 5, 8, 10, 12, 16, 20, 25, 30, 40, 50

Typical range of values: 1 ≤ MinAmplitude MinAmplitude MinAmplitude MinAmplitude minAmplitude ≤ 255

Minimum increment: 1

Recommended increment: 1

Restriction: MinAmplitude >= 0

MaxGapLengthMaxGapLengthMaxGapLengthMaxGapLengthmaxGapLength (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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, 30, 40, 50, 70, 100

Typical range of values: 1 ≤ MaxGapLength MaxGapLength MaxGapLength MaxGapLength maxGapLength ≤ 127

Minimum increment: 1

Recommended increment: 1

Restriction: (MaxGapLength > 0) && (MaxGapLength <= 127)

Example (C)

sobel_amp(Image,&EdgeAmp,"sum_abs",5);
threshold(EdgeAmp,&EdgeRegion,40.0,255.0);
skeleton(EdgeRegion,&ThinEdge);
close_edges_length(ThinEdge,EdgeAmp,&CloseEdges,15,3);

Result

close_edges_lengthclose_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLength returns 2 (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>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

edges_imageedges_imageedges_imageEdgesImageEdgesImage, sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, thresholdthresholdthresholdThresholdThreshold, skeletonskeletonskeletonSkeletonSkeleton

Alternatives

close_edgesclose_edgesclose_edgesCloseEdgesCloseEdges, dilation1dilation1dilation1Dilation1Dilation1, closingclosingclosingClosingClosing

References

M. Üsbeck: “Untersuchungen zur echtzeitfähigen Segmentierung”; Studienarbeit, Bayerisches Forschungszentrum für Wissensbasierte Systeme (FORWISS), Erlangen, 1993.

Module

Foundation


Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH