detect_edge_segments — 检测直边段。
detect_edge_segments(Image : : SobelSize, MinAmplitude, MaxDistance, MinLength : BeginRow, BeginCol, EndRow, EndCol)
detect_edge_segments detects straight edge segments in the gray
image Image. The extracted edge segments are returned as
line segments with start point (BeginRow,BeginCol)
and end point (EndRow,EndCol). Edge detection
is based on the Sobel filter, using 'sum_abs' as parameter and
SobelSize as the filter mask size (see
sobel_amp). Only pixels with a filter response larger
than MinAmplitude are used as candidates for edge points.
These thresholded edge points are thinned and split into straight
segments. Due to technical reasons, edge points in which several
edges meet are lost. Therefore, detect_edge_segments usually
does not return closed object contours. The parameter
MaxDistance controls the maximum allowed distance of an
edge point to its approximating line. For efficiency reasons, the
sum of the absolute values of the coordinate differences is used
instead of the Euclidean distance. MinLength controls
the minimum length of the line segments. Lines shorter than
MinLength are not returned.
请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章
Image (输入对象) (multichannel-)image(-array) → object (byte)
输入图像。
SobelSize (输入控制) integer → (integer)
Mask size of the Sobel operator.
默认值: 5
值列表: 3, 5, 7, 9, 11, 13
MinAmplitude (输入控制) integer → (integer)
Minimum edge strength.
默认值: 32
建议值: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 80, 90, 100, 110
值范围:
1
≤
MinAmplitude
≤
255
最小增量: 1
建议增量: 1
MaxDistance (输入控制) integer → (integer)
Maximum distance of the approximating line to its original edge.
默认值: 3
建议值: 2, 3, 4, 5, 6, 7, 8
值范围:
0
≤
MaxDistance
最小增量: 1
建议增量: 1
MinLength (输入控制) integer → (integer)
Minimum length of to resulting line segments.
默认值: 10
建议值: 3, 5, 7, 9, 11, 13, 16, 20
值范围:
1
≤
MinLength
最小增量: 1
建议增量: 1
BeginRow (输出控制) line.begin.y-array → (integer)
Row coordinate of the line segments' start points.
BeginCol (输出控制) line.begin.x-array → (integer)
Column coordinate of the line segments' start points.
EndRow (输出控制) line.end.y-array → (integer)
Row coordinate of the line segments' end points.
EndCol (输出控制) line.end.x-array → (integer)
Column coordinate of the line segments' end points.
Htuple SobelSize,MinAmplitude,MaxDistance,MinLength;
Htuple RowBegin,ColBegin,RowEnd,ColEnd;
create_tuple(&SobelSize,1);
set_i(SobelSize,5,0);
create_tuple(&MinAmplitude,1);
set_i(MinAmplitude,32,0);
create_tuple(&MaxDistance,1);
set_i(MaxDistance,3,0);
create_tuple(&MinLength,1);
set_i(MinLength,10,0);
T_detect_edge_segments(Image,SobelSize,MinAmplitude,MaxDistance,MinLength,
&RowBegin,&ColBegin,&RowEnd,&ColEnd);
detect_edge_segments 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空则可设置行为通过 set_system('no_object_result',<Result>)。如有必要,则抛出异常。
partition_lines,
line_position,
line_orientation
sobel_amp,
threshold,
skeleton
基础