detect_edges1 ( Image : : SobelSize, MinAmplitude, MaxDistance, MinLength : BeginRow, BeginCol, EndRow, EndCol )

Detect straight edge segments.

detect_edges1 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_edges1 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.


Parameters

Image (input_object)
image(-array) -> object : byte
Input image.

SobelSize (input_control)
integer -> integer
Mask size of the Sobel operator.
Default value: 5
List of values: 3, 5, 7, 9, 11, 13

MinAmplitude (input_control)
integer -> integer
Minimum edge strength.
Default value: 32
Suggested values: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 80, 90, 100, 110
Range of values: 1 <= MinAmplitude <= 255
Minimum increment: 1
Recommended increment: 1
Restriction: MinAmplitude >= 0

MaxDistance (input_control)
integer -> integer
Maximum distance of the approximating line to its original edge.
Default value: 3
Suggested values: 2, 3, 4, 5, 6, 7, 8
Range of values: 1 <= MaxDistance <= 30
Minimum increment: 1
Recommended increment: 1
Restriction: MaxDistance >= 0

MinLength (input_control)
integer -> integer
Minimum lenght of to resulting line segments.
Default value: 10
Suggested values: 3, 5, 7, 9, 11, 13, 16, 20
Range of values: 1 <= MinLength <= 500
Minimum increment: 1
Recommended increment: 1
Restriction: MinLength >= 0

BeginRow (output_control)
line.begin.y-array -> integer
Row coordinate of the line segments' start points.

BeginCol (output_control)
line.begin.x-array -> integer
Column coordinate of the line segments' start points.

EndRow (output_control)
line.end.y-array -> integer
Row coordinate of the line segments' end points.

EndCol (output_control)
line.end.x-array -> integer
Column coordinate of the line segments' end points.


Example
T_detect_edges1(Image,5,32,3,10,&RowBegin,&ColBegin,&RowEnd,&ColEnd);
t_dist_line(RowBegin,ColBegin,RowEnd,ColEnd);

Result

detect_edges1 returns 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 is raised.


Possible Predecessors

sigma__, median


Possible Successors

select_lines1, select_lines1, select_longest_lines, line_position, line_orientation


Alternatives

sobel_amp, threshold__, skeleton



Copyright © 1996-1997 MVTec Software GmbH