HALCON Reference Manual 10.0.2
Name
hough_lines_dirT_hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDir — Detect lines in edge images with the help of the Hough transform
using local gradient direction and return them in normal form.
Herror T_hough_lines_dir(const Hobject ImageDir, Hobject* HoughImage, Hobject* Lines, const Htuple DirectionUncertainty, const Htuple AngleResolution, const Htuple Smoothing, const Htuple FilterSize, const Htuple Threshold, const Htuple AngleGap, const Htuple DistGap, const Htuple GenLines, Htuple* Angle, Htuple* Dist)
Herror hough_lines_dir(Hobject ImageDir, Hobject* HoughImage, Hobject* Lines, const HTuple& DirectionUncertainty, const HTuple& AngleResolution, const HTuple& Smoothing, const HTuple& FilterSize, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, const HTuple& GenLines, HTuple* Angle, HTuple* Dist)
HImage HImage::HoughLinesDir(HRegionArray* Lines, const HTuple& DirectionUncertainty, const HTuple& AngleResolution, const HTuple& Smoothing, const HTuple& FilterSize, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, const HTuple& GenLines, HTuple* Angle, HTuple* Dist) const
void HOperatorSetX.HoughLinesDir(
[in] IHUntypedObjectX* ImageDir, [out] IHUntypedObjectX** HoughImage, [out] IHUntypedObjectX** Lines, [in] VARIANT DirectionUncertainty, [in] VARIANT AngleResolution, [in] VARIANT Smoothing, [in] VARIANT FilterSize, [in] VARIANT Threshold, [in] VARIANT AngleGap, [in] VARIANT DistGap, [in] VARIANT GenLines, [out] VARIANT* Angle, [out] VARIANT* Dist)
IHImageX* HImageX.HoughLinesDir(
[out] IHRegionX** Lines, [in] Hlong DirectionUncertainty, [in] Hlong AngleResolution, [in] BSTR Smoothing, [in] Hlong FilterSize, [in] Hlong Threshold, [in] Hlong AngleGap, [in] Hlong DistGap, [in] BSTR GenLines, [out] VARIANT* Angle, [out] VARIANT* Dist)
static void HOperatorSet.HoughLinesDir(HObject imageDir, out HObject houghImage, out HObject lines, HTuple directionUncertainty, HTuple angleResolution, HTuple smoothing, HTuple filterSize, HTuple threshold, HTuple angleGap, HTuple distGap, HTuple genLines, out HTuple angle, out HTuple dist)
HImage HImage.HoughLinesDir(out HRegion lines, int directionUncertainty, int angleResolution, string smoothing, int filterSize, int threshold, int angleGap, int distGap, string genLines, out HTuple angle, out HTuple dist)
The operator hough_lines_dirhough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDir selects line-like
structures in a region based on the Hough transform. The individual
points of a line can be unconnected. The region is given by the domain
of ImageDirImageDirImageDirImageDirimageDir. The lines are returned in Hessian normal form (HNF),
that is by the direction and length of their normal vector.
In contrast to hough_lineshough_lineshough_linesHoughLinesHoughLines, additionally the edge direction in
ImageDirImageDirImageDirImageDirimageDir (e.g., returned by sobel_dirsobel_dirsobel_dirSobelDirSobelDir or
edges_imageedges_imageedges_imageEdgesImageEdgesImage) is taken into account. This results in a more efficient
computation and in a reduction of the noise in the Hough space.
The parameter DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertainty describes how much the edge
direction of the individual points within a line is allowed to vary. For
example, with DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertainty = 10 a horizontal
line (i.e., edge direction = 0 degrees) may contain points with an edge
direction between -10 and +10 degrees. The higher
DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertainty is chosen, the higher the computation time
will be. For DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertainty = 180
hough_lines_dirhough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDir shows the same behavior as
hough_lineshough_lineshough_linesHoughLinesHoughLines, i.e., the edge direction is ignored.
DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertainty should be chosen at least as high as the
step width of the edge direction stored in ImageDirImageDirImageDirImageDirimageDir. The minimum
step width is 2 degrees (defined by the image type 'direction').
The parameter AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolution defines how accurately the
angles are determined. The accuracy amounts to 1 /
AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolution degrees. A subsequent smoothing of the
Hough space results in an increased stability. The smoothing filter can be
selected by SmoothingSmoothingSmoothingSmoothingsmoothing, the degree of smoothing by the
parameter FilterSizeFilterSizeFilterSizeFilterSizefilterSize (see mean_imagemean_imagemean_imageMeanImageMeanImage or
gauss_imagegauss_imagegauss_imageGaussImageGaussImage for details).
The parameter ThresholdThresholdThresholdThresholdthreshold
determines by how many points of the original region a line's hypothesis
must at least be supported in order to be selected into the output.
The parameters AngleGapAngleGapAngleGapAngleGapangleGap and DistGapDistGapDistGapDistGapdistGap define a
neighborhood of the points in the Hough image in order to determine the
local maxima: AngleGapAngleGapAngleGapAngleGapangleGap describes the minimum distance of two
maxima in the Hough image in angle direction and DistGapDistGapDistGapDistGapdistGap in
distance direction, respectively. Thus, maxima exceeding
ThresholdThresholdThresholdThresholdthreshold but lying close to an even higher maximum are eliminated.
This can particularly be helpful when searching for short and long
lines simultaneously. Besides the unsmoothed Hough image
HoughImageHoughImageHoughImageHoughImagehoughImage, the lines are returned in
HNF (AngleAngleAngleAngleangle, DistDistDistDistdist).
If the parameter GenLinesGenLinesGenLinesGenLinesgenLines is set to 'true'"true""true""true""true", additionally
those regions in ImageDirImageDirImageDirImageDirimageDir are returned that contributed to the
local maxima in Hough space. They are stored in the parameter
LinesLinesLinesLineslines.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Image containing the edge direction. The edges are
described by the image domain.
Regions of the input image that contributed to the
local maxima.
Uncertainty of edge direction (in degrees).
Default value: 2
Typical range of values: 2
≤
DirectionUncertainty
DirectionUncertainty
DirectionUncertainty
DirectionUncertainty
directionUncertainty
≤
180
Minimum increment: 2
Resolution in the angle area (in 1/degrees).
Default value: 4
List of values: 1, 2, 4, 8
Smoothing filter for hough image.
Default value:
'mean'
"mean"
"mean"
"mean"
"mean"
List of values: 'none'"none""none""none""none", 'mean'"mean""mean""mean""mean", 'gauss'"gauss""gauss""gauss""gauss"
Required smoothing filter size.
Default value: 5
List of values: 3, 5, 7, 9, 11
Threshold value in the Hough image.
Default value: 100
Typical range of values: 1
≤
Threshold
Threshold
Threshold
Threshold
threshold
Minimum distance of two maxima in the Hough image
(direction: angle).
Default value: 5
Typical range of values: 0
≤
AngleGap
AngleGap
AngleGap
AngleGap
angleGap
Minimum distance of two maxima in the Hough image
(direction: distance).
Default value: 5
Typical range of values: 0
≤
DistGap
DistGap
DistGap
DistGap
distGap
Create line regions if 'true'"true""true""true""true".
Default value:
'true'
"true"
"true"
"true"
"true"
List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"
Angles (in radians) of the detected lines' normal
vectors.
Typical range of values: -1.5707963
≤
Angle
Angle
Angle
Angle
angle
≤
3.1415927
DistDistDistDistdist (output_control) hesseline.distance-array → HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)
Distance of the detected lines from the origin.
Number of elements: Dist == Angle
Typical range of values: 0
≤
Dist
Dist
Dist
Dist
dist
The operator hough_lineshough_lineshough_linesHoughLinesHoughLines returns the value 2 (H_MSG_TRUE)
if the input is not empty.
The behavior in case of empty input (no input regions available) is
set via the operator set_system('no_object_result',<Result>)set_system("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.
edges_imageedges_imageedges_imageEdgesImageEdgesImage,
sobel_dirsobel_dirsobel_dirSobelDirSobelDir,
thresholdthresholdthresholdThresholdThreshold,
nonmax_suppression_dirnonmax_suppression_dirnonmax_suppression_dirNonmaxSuppressionDirNonmaxSuppressionDir,
reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain,
skeletonskeletonskeletonSkeletonSkeleton
gen_region_hlinegen_region_hlinegen_region_hlineGenRegionHlineGenRegionHline,
select_matching_linesselect_matching_linesselect_matching_linesSelectMatchingLinesSelectMatchingLines
hough_line_trans_dirhough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDir,
hough_line_transhough_line_transhough_line_transHoughLineTransHoughLineTrans,
gen_region_hlinegen_region_hlinegen_region_hlineGenRegionHlineGenRegionHline,
hough_circleshough_circleshough_circlesHoughCirclesHoughCircles
Foundation
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |