ClassesClasses | | Operators

close_edgesclose_edgesCloseEdgesCloseEdges (Operator)

Name

close_edgesclose_edgesCloseEdgesCloseEdges — Close edge gaps using the edge amplitude image.

Signature

close_edges(Edges, EdgeImage : RegionResult : MinAmplitude : )

Herror close_edges(const Hobject Edges, const Hobject EdgeImage, Hobject* RegionResult, const Hlong MinAmplitude)

Herror T_close_edges(const Hobject Edges, const Hobject EdgeImage, Hobject* RegionResult, const Htuple MinAmplitude)

void CloseEdges(const HObject& Edges, const HObject& EdgeImage, HObject* RegionResult, const HTuple& MinAmplitude)

HRegion HRegion::CloseEdges(const HImage& EdgeImage, Hlong MinAmplitude) const

static void HOperatorSet.CloseEdges(HObject edges, HObject edgeImage, out HObject regionResult, HTuple minAmplitude)

HRegion HRegion.CloseEdges(HImage edgeImage, int minAmplitude)

Description

close_edgesclose_edgesCloseEdgesCloseEdgesCloseEdges 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 MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitude. This operator expects as input the edges (EdgesEdgesEdgesEdgesedges) and amplitude image (EdgeImageEdgeImageEdgeImageEdgeImageedgeImage) returned by typical edge operators, such as edges_imageedges_imageEdgesImageEdgesImageEdgesImage or sobel_ampsobel_ampSobelAmpSobelAmpSobelAmp. close_edgesclose_edgesCloseEdgesCloseEdgesCloseEdges 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.”

Attention

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.

Execution Information

Parameters

EdgesEdgesEdgesEdgesedges (input_object)  region(-array) objectHRegionHRegionHobject

Region containing one pixel thick edges.

EdgeImageEdgeImageEdgeImageEdgeImageedgeImage (input_object)  singlechannelimage objectHImageHImageHobject (byte / uint2 / int4)

Edge amplitude (gradient) image.

RegionResultRegionResultRegionResultRegionResultregionResult (output_object)  region(-array) objectHRegionHRegionHobject *

Region containing closed edges.

MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitude (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (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

Example (C)

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);

Result

close_edgesclose_edgesCloseEdgesCloseEdgesCloseEdges returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

edges_imageedges_imageEdgesImageEdgesImageEdgesImage, sobel_ampsobel_ampSobelAmpSobelAmpSobelAmp, thresholdthresholdThresholdThresholdThreshold, skeletonskeletonSkeletonSkeletonSkeleton

Possible Successors

skeletonskeletonSkeletonSkeletonSkeleton

Alternatives

close_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLengthCloseEdgesLength, dilation1dilation1Dilation1Dilation1Dilation1, closingclosingClosingClosingClosing

See also

gray_skeletongray_skeletonGraySkeletonGraySkeletonGraySkeleton

Module

Foundation


ClassesClasses | | Operators