Detection of lines using Gaussian smoothing.
The operator lines_gauss can be used to extract lines (curvilinear structures) from the image Image. The extracted lines are returned in Lines as sub-pixel precise XLD-contours. The parameter LightDark determines, whether bright or dark lines are extracted.
The extraction is done by using partial derivatives of a Gaussian smoothing kernel to determine the parameters of a quadratic polynomial in x and y for each point of the image. The parameter Sigma determines the amount of smoothing to be performed. Larger values of Sigma lead to a larger smoothing of the image, but can lead to worse localization of the line. Generally, the localization will be much better than that of lines returned by lines_facet with comparable parameters. The parameters of the polynomial are used to calculate the line direction for each pixel. Pixels which exhibit a local maximum in the second directional derivative perpendicular to the line direction are marked as line points. The line points found in this manner are then linked to contours. This is done by immediately accepting line points that have a second derivative larger than High. Points that have a second derivative smaller than Low are rejected. All other line points are accepted if they are connected to accepted points by a connected path. This is similar to a hysteresis threshold operation with infinite path length (see hysteresis_threshold__). However, this function is not used internally since it does not allow the extraction of sub-pixel precise contours.
For the choice of the thresholds High and Low one has to keep in mind that the second directional derivative depends on the amplitude and width of the line as well as the choice of Sigma. The value of the second derivative depends linearly on the amplitude, i.e., the larger the amplitude, the larger the response. For the width of the line there is an approximately inverse exponential dependence: The wider the line is, the smaller the response gets. This holds analogously for the dependence on Sigma: The larger Sigma is chosen, the smaller the second derivative will be. This means that for larger smoothing correspondingly smaller values for High and Low have to be chosen. Two examples help to illustrate this: If 5 pixel wide lines with an amplitude larger than 100 are to be extracted from an image with a smoothing of Sigma = 1.5, High should be chosen larger than 14. If, on the other hand, 10 pixel wide lines with an amplitude larger than 100 and a Sigma = 3 are to be detected, High should be chosen larger than 3.5. For the choice of Low values between 0.25 High and 0.5 High are appropriate.
The extracted lines are returned in a topologically sound data structure in Lines. This means that lines are correctly split at junction points.
The smaller the smoothing Sigma is chosen, the more short, fragmented lines will be extracted. This can lead to considerably longer execution times.
Image (input_object) |
singlechannelimage -> object : byte |
Input image. |
Lines (output_object) |
xld_cont-array -> object |
Extracted lines. |
Sigma (input_control) |
number -> real / integer |
Amount of Gaussian smoothing to be applied. | |
Default value: 1.5 | |
Suggested values: 1, 1.2, 1.5, 1.8, 2, 2.5, 3, 4, 5 | |
Range of values: 0.7 <= Sigma <= 20 | |
Recommended increment: 0.1 |
Low (input_control) |
number -> real / integer |
Lower threshold for the hysteresis threshold operation. | |
Default value: 3 | |
Suggested values: 0, 0.5, 1, 2, 3, 4, 5, 8, 10 | |
Range of values: 0 <= Low <= 20 | |
Recommended increment: 0.5 | |
Restriction: Low >= 0 |
High (input_control) |
number -> real / integer |
Upper threshold for the hysteresis threshold operation. | |
Default value: 8 | |
Suggested values: 0, 0.5, 1, 2, 3, 4, 5, 8, 10, 12, 15, 18, 20, 25 | |
Range of values: 0 <= High <= 35 | |
Recommended increment: 0.5 | |
Restriction: (High >= 0) && (High >= Low) |
LightDark (input_control) |
string -> string |
Extract bright or dark lines. | |
Default value: 'light' | |
List of values: 'dark', 'light' |
/* Detection of lines in an aerial image */ read_image(:Image:'mreut4_3':) > lines_gauss(Image:Lines:1.5,3,8,'light':) > disp_xld(Lines).
lines_gauss returns TRUE if all parameters are correct and no error occurs during execution. If the input is empty the behaviour can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.
bandpass__, dyn_threshold__, topographic_sketch
C. Steger: "Extracting Curvilinear Structures: A Differential Geometric Approach". In B. Buxton, R. Cipolla, eds., "Fourth European Conference on Computer Vision", Lecture Notes in Computer Science, Volume 1064, Springer Verlag, pp. 630-641, 1996.