Name
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss — Detect lines and their width.
Herror lines_gauss(const Hobject Image, Hobject* Lines, double Sigma, double Low, double High, const char* LightDark, const char* ExtractWidth, const char* LineModel, const char* CompleteJunctions)
Herror T_lines_gauss(const Hobject Image, Hobject* Lines, const Htuple Sigma, const Htuple Low, const Htuple High, const Htuple LightDark, const Htuple ExtractWidth, const Htuple LineModel, const Htuple CompleteJunctions)
Herror lines_gauss(Hobject Image, Hobject* Lines, const HTuple& Sigma, const HTuple& Low, const HTuple& High, const HTuple& LightDark, const HTuple& ExtractWidth, const HTuple& LineModel, const HTuple& CompleteJunctions)
HXLDContArray HImage::LinesGauss(const HTuple& Sigma, const HTuple& Low, const HTuple& High, const HTuple& LightDark, const HTuple& ExtractWidth, const HTuple& LineModel, const HTuple& CompleteJunctions) const
void LinesGauss(const HObject& Image, HObject* Lines, const HTuple& Sigma, const HTuple& Low, const HTuple& High, const HTuple& LightDark, const HTuple& ExtractWidth, const HTuple& LineModel, const HTuple& CompleteJunctions)
HXLDCont HImage::LinesGauss(const HTuple& Sigma, const HTuple& Low, const HTuple& High, const HString& LightDark, const HString& ExtractWidth, const HString& LineModel, const HString& CompleteJunctions) const
HXLDCont HImage::LinesGauss(double Sigma, double Low, double High, const HString& LightDark, const HString& ExtractWidth, const HString& LineModel, const HString& CompleteJunctions) const
HXLDCont HImage::LinesGauss(double Sigma, double Low, double High, const char* LightDark, const char* ExtractWidth, const char* LineModel, const char* CompleteJunctions) const
void HOperatorSetX.LinesGauss(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX** Lines, [in] VARIANT Sigma, [in] VARIANT Low, [in] VARIANT High, [in] VARIANT LightDark, [in] VARIANT ExtractWidth, [in] VARIANT LineModel, [in] VARIANT CompleteJunctions)
IHXLDContX* HImageX.LinesGauss(
[in] VARIANT Sigma, [in] VARIANT Low, [in] VARIANT High, [in] BSTR LightDark, [in] BSTR ExtractWidth, [in] BSTR LineModel, [in] BSTR CompleteJunctions)
static void HOperatorSet.LinesGauss(HObject image, out HObject lines, HTuple sigma, HTuple low, HTuple high, HTuple lightDark, HTuple extractWidth, HTuple lineModel, HTuple completeJunctions)
HXLDCont HImage.LinesGauss(HTuple sigma, HTuple low, HTuple high, string lightDark, string extractWidth, string lineModel, string completeJunctions)
HXLDCont HImage.LinesGauss(double sigma, double low, double high, string lightDark, string extractWidth, string lineModel, string completeJunctions)
The operator lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss can be used to extract lines
(curvilinear structures) from the image ImageImageImageImageImageimage. The
extracted lines are returned in LinesLinesLinesLinesLineslines as subpixel precise
XLD-contours. The parameter LightDarkLightDarkLightDarkLightDarkLightDarklightDark determines, whether
bright or dark lines are extracted. If ExtractWidthExtractWidthExtractWidthExtractWidthExtractWidthextractWidth is set
to 'true'"true""true""true""true""true" the line width is extracted for each line point.
If LineModelLineModelLineModelLineModelLineModellineModel is set to a value different from
'none'"none""none""none""none""none", lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss compensates the effect of
asymmetrical lines (lines having different contrast on each side of
the line), and corrects the position and width of the line. The
line model used for the correction can be selected with
LineModelLineModelLineModelLineModelLineModellineModel as bar-shaped lines (LineModelLineModelLineModelLineModelLineModellineModel =
'bar-shaped'"bar-shaped""bar-shaped""bar-shaped""bar-shaped""bar-shaped"), parabolic lines (LineModelLineModelLineModelLineModelLineModellineModel =
'parabolic'"parabolic""parabolic""parabolic""parabolic""parabolic"), and Gaussian lines (LineModelLineModelLineModelLineModelLineModellineModel =
'gaussian'"gaussian""gaussian""gaussian""gaussian""gaussian"). Bar-shaped lines are the right choice for
most applications. If backlit tubular objects (e.g., blood vessels
in X-ray images) should be extracted, the other two modes can be
used. The parabolic line model should be used in applications where
the lines appear very sharp. The Gaussian line model should be used
in applications where the lines appear less sharp. The parameter
LineModelLineModelLineModelLineModelLineModellineModel is only meaningful if
ExtractWidthExtractWidthExtractWidthExtractWidthExtractWidthextractWidth='true'"true""true""true""true""true". Because the line extractor
is unable to extract certain junctions because of differential
geometric reasons, it tries to extract these by different means if
CompleteJunctionsCompleteJunctionsCompleteJunctionsCompleteJunctionsCompleteJunctionscompleteJunctions is set to 'true'"true""true""true""true""true".
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
SigmaSigmaSigmaSigmaSigmasigma determines the amount of smoothing to be performed.
Larger values of SigmaSigmaSigmaSigmaSigmasigma 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_facetlines_facetLinesFacetlines_facetLinesFacetLinesFacet 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 HighHighHighHighHighhigh.
Points that have a second derivative smaller than LowLowLowLowLowlow 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_thresholdhysteresis_thresholdHysteresisThresholdhysteresis_thresholdHysteresisThresholdHysteresisThreshold). However, this function is not used
internally since it does not allow the extraction of subpixel
precise contours.
For the choice of the thresholds HighHighHighHighHighhigh and LowLowLowLowLowlow
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 SigmaSigmaSigmaSigmaSigmasigma. 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 SigmaSigmaSigmaSigmaSigmasigma: The larger SigmaSigmaSigmaSigmaSigmasigma is
chosen, the smaller the second derivative will be. This means that
for larger smoothing correspondingly smaller values for
HighHighHighHighHighhigh and LowLowLowLowLowlow 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 SigmaSigmaSigmaSigmaSigmasigma = 1.5, HighHighHighHighHighhigh should be chosen larger
than 14. If, on the other hand, 10 pixel wide lines with an
amplitude larger than 100 and a SigmaSigmaSigmaSigmaSigmasigma = 3 are to be
detected, HighHighHighHighHighhigh should be chosen larger than 3.5. For the
choice of LowLowLowLowLowlow values between 0.25 HighHighHighHighHighhigh and 0.5
HighHighHighHighHighhigh are appropriate.
The extracted lines are returned in a topologically sound data
structure in LinesLinesLinesLinesLineslines. This means that lines are correctly
split at junction points.
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss defines the following attributes for each
line point if ExtractWidthExtractWidthExtractWidthExtractWidthExtractWidthextractWidth was set to 'false'"false""false""false""false""false":
- 'angle'"angle""angle""angle""angle""angle":
The angle of the direction perpendicular
to the line
- 'response'"response""response""response""response""response":
The magnitude of the second derivative
If ExtractWidthExtractWidthExtractWidthExtractWidthExtractWidthextractWidth was set to 'true'"true""true""true""true""true", the following
attributes are defined in addition to 'angle'"angle""angle""angle""angle""angle" and
'response'"response""response""response""response""response":
- 'width_left'"width_left""width_left""width_left""width_left""width_left":
The line width to the left of the line
- 'width_right'"width_right""width_right""width_right""width_right""width_right":
The line width to the right of the line
If ExtractWidthExtractWidthExtractWidthExtractWidthExtractWidthextractWidth was set to 'true'"true""true""true""true""true" and
LineModelLineModelLineModelLineModelLineModellineModel to a value different from 'none'"none""none""none""none""none", the
following attributes are defined in addition to 'angle'"angle""angle""angle""angle""angle",
'response'"response""response""response""response""response", 'width_left'"width_left""width_left""width_left""width_left""width_left", and
'width_right'"width_right""width_right""width_right""width_right""width_right":
- 'asymmetry'"asymmetry""asymmetry""asymmetry""asymmetry""asymmetry":
The asymmetry of the line point
- 'contrast'"contrast""contrast""contrast""contrast""contrast":
The contrast of the line point
Here, the asymmetry is positive if the asymmetric part, i.e., the
part with the weaker gradient, is on the right side of the line,
while it is negative if the asymmetric part is on the left side of
the line. All these attributes can be queried via the operator
get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld.
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss can be executed on OpenCL devices.
In general, but in particular if the line width is to be extracted,
SigmaSigmaSigmaSigmaSigmasigma >= w/sqrt(3)
should be selected, where w is the width (half the diameter) of
the lines in the image. As the lowest allowable value
SigmaSigmaSigmaSigmaSigmasigma >= w/2.5
must be selected. If, for example, lines with a width of
4 pixels (diameter 8 pixels) are to be extracted, SigmaSigmaSigmaSigmaSigmasigma >= 2.3 should be selected.
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss uses a special implementation that is optimized
using SSE2 instructions if the system parameter
'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable""sse2_enable" is set to 'true'"true""true""true""true""true" (which is default
if SSE2 is available on your machine). This implementation is
slightly inaccurate compared to the pure C version due to numerical
issues. If you prefer accuracy over performance you can set
'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable""sse2_enable" to 'false'"false""false""false""false""false" (using
set_systemset_systemSetSystemset_systemSetSystemSetSystem) before you call lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss. This way
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss does not use SSE2 accelerations. Don't forget
to set 'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable""sse2_enable" back to 'true'"true""true""true""true""true" afterwards.
When lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss is run on OpenCL devices, the same limitations
apply as for derivate_gaussderivate_gaussDerivateGaussderivate_gaussDerivateGaussDerivateGauss: SigmaSigmaSigmaSigmaSigmasigma must be chosen so that
the required filter mask is smaller than 129 pixels. Also note that the
results can vary compared to the CPU implementation.
- Supports OpenCL compute devices.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
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
Typical range of values: 0.7
≤
Sigma
Sigma
Sigma
Sigma
Sigma
sigma
≤
20
Recommended increment: 0.1
LowLowLowLowLowlow (input_control) number → HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)
Lower threshold for the hysteresis threshold
operation.
Default value: 3
Suggested values: 0, 0.5, 1, 2, 3, 4, 5, 8, 10
Typical range of values: 0
≤
Low
Low
Low
Low
Low
low
≤
20
Recommended increment: 0.5
Restriction: Low >= 0
HighHighHighHighHighhigh (input_control) number → HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)
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
Typical range of values: 0
≤
High
High
High
High
High
high
≤
35
Recommended increment: 0.5
Restriction: High >= 0 && High >= Low
Extract bright or dark lines.
Default value:
'light'
"light"
"light"
"light"
"light"
"light"
List of values: 'dark'"dark""dark""dark""dark""dark", 'light'"light""light""light""light""light"
Should the line width be extracted?
Default value:
'true'
"true"
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
Line model used to correct the line position and width.
Default value:
'bar-shaped'
"bar-shaped"
"bar-shaped"
"bar-shaped"
"bar-shaped"
"bar-shaped"
List of values: 'bar-shaped'"bar-shaped""bar-shaped""bar-shaped""bar-shaped""bar-shaped", 'gaussian'"gaussian""gaussian""gaussian""gaussian""gaussian", 'none'"none""none""none""none""none", 'parabolic'"parabolic""parabolic""parabolic""parabolic""parabolic"
Should junctions be added where they cannot be
extracted?
Default value:
'true'
"true"
"true"
"true"
"true"
"true"
List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_gauss(Image,Lines,1.5,3,8,'light','true','bar-shaped','true')
disp_xld(Lines,WindowHandle)
/* Detection of lines in an aerial image */
read_image(&Image,"mreut4_3");
lines_gauss(Image:&Lines:1.5,3,8,"light","true","bar-shaped","true");
disp_xld(Lines,WindowHandle);
* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_gauss(Image,Lines,1.5,3,8,'light','true','bar-shaped','true')
disp_xld(Lines,WindowHandle)
/* Detection of lines in an aerial image */
HWindow w(0,0,520,560);
HImage Image("mreut4_3");
HXLDContArray Lines = Image.LinesGauss(1.5,3,8,"light","true",
"bar-shaped","true");
Lines.Display(w);
* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_gauss(Image,Lines,1.5,3,8,'light','true','bar-shaped','true')
disp_xld(Lines,WindowHandle)
* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_gauss(Image,Lines,1.5,3,8,'light','true','bar-shaped','true')
disp_xld(Lines,WindowHandle)
Let A be the number of pixels in the domain of ImageImageImageImageImageimage.
Then the runtime complexity is O(A*Sigma).
The amount of temporary memory required is dependent on the height
H of the domain of ImageImageImageImageImageimage and the width W of
ImageImageImageImageImageimage. Let S = W*H, then lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss requires at
least 55*S bytes of temporary memory during execution.
lines_gausslines_gaussLinesGausslines_gaussLinesGaussLinesGauss returns 2 (H_MSG_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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary,
an exception is raised.
gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld
lines_facetlines_facetLinesFacetlines_facetLinesFacetLinesFacet
bandpass_imagebandpass_imageBandpassImagebandpass_imageBandpassImageBandpassImage,
dyn_thresholddyn_thresholdDynThresholddyn_thresholdDynThresholdDynThreshold,
topographic_sketchtopographic_sketchTopographicSketchtopographic_sketchTopographicSketchTopographicSketch
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.
C. Steger: “Extraction of Curved Lines from Images”. In “13th
International Conference on Pattern Recognition”, Volume II,
pp. 251-255, 1996.
C. Steger: “An Unbiased Detector of Curvilinear Structures”.
IEEE Transactions on Pattern Analysis and Machine Intelligence,
vol. 20, no. 2, pp. 113-125, 1998.
2D Metrology