close_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLengthclose_edges_length (算子)

名称

close_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLengthclose_edges_length — 使用边缘振幅图像闭合边缘间隙。

签名

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)

void CloseEdgesLength(const HObject& Edges, const HObject& Gradient, HObject* ClosedEdges, const HTuple& MinAmplitude, const HTuple& MaxGapLength)

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

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

HRegion HRegion.CloseEdgesLength(HImage gradient, int minAmplitude, int maxGapLength)

def close_edges_length(edges: HObject, gradient: HObject, min_amplitude: int, max_gap_length: int) -> HObject

描述

close_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLengthCloseEdgesLengthclose_edges_length closes gaps in the output of an edge detector, and thus tries to produce complete object contours. This operator expects as input the edges (EdgesEdgesEdgesEdgesedgesedges) and amplitude image (GradientGradientGradientGradientgradientgradient) returned by typical edge operators, such as edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image or sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp

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 MaxGapLengthMaxGapLengthMaxGapLengthMaxGapLengthmaxGapLengthmax_gap_length 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 MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitudemin_amplitude. 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.

注意

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

EdgesEdgesEdgesEdgesedgesedges (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

Region containing one pixel thick edges.

GradientGradientGradientGradientgradientgradient (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2)

Edge amplitude (gradient) image.

ClosedEdgesClosedEdgesClosedEdgesClosedEdgesclosedEdgesclosed_edges (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

Region containing closed edges.

MinAmplitudeMinAmplitudeMinAmplitudeMinAmplitudeminAmplitudemin_amplitude (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

最小边缘振幅。

默认值: 16

建议值: 5, 8, 10, 12, 16, 20, 25, 30, 40, 50

值范围: 0 ≤ MinAmplitude MinAmplitude MinAmplitude MinAmplitude minAmplitude min_amplitude ≤ 255

最小增量: 1

建议增量: 1

MaxGapLengthMaxGapLengthMaxGapLengthMaxGapLengthmaxGapLengthmax_gap_length (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximal number of points by which edges are extended.

默认值: 3

建议值: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 40, 50, 70, 100

值范围: 1 ≤ MaxGapLength MaxGapLength MaxGapLength MaxGapLength maxGapLength max_gap_length ≤ 127

最小增量: 1

建议增量: 1

示例(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);

结果

close_edges_lengthclose_edges_lengthCloseEdgesLengthCloseEdgesLengthCloseEdgesLengthclose_edges_length 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空则可设置行为通过 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>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image, sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp, thresholdthresholdThresholdThresholdThresholdthreshold, skeletonskeletonSkeletonSkeletonSkeletonskeleton

替代

close_edgesclose_edgesCloseEdgesCloseEdgesCloseEdgesclose_edges, dilation1dilation1Dilation1Dilation1Dilation1dilation1, closingclosingClosingClosingClosingclosing

参考文献

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

模块

基础