hough_lines_dirT_hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dir(算子)

名称

hough_lines_dirT_hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dir — 在霍夫变换的帮助下,使用局部梯度方向检测边缘图像中的线,并以正常形式返回。

签名

hough_lines_dir(ImageDir : HoughImage, Lines : DirectionUncertainty, AngleResolution, Smoothing, FilterSize, Threshold, AngleGap, DistGap, GenLines : Angle, Dist)

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)

void HoughLinesDir(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)

HImage HImage::HoughLinesDir(HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const HString& Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const HString& GenLines, HTuple* Angle, HTuple* Dist) const

HImage HImage::HoughLinesDir(HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const char* Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const char* GenLines, HTuple* Angle, HTuple* Dist) const

HImage HImage::HoughLinesDir(HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const wchar_t* Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const wchar_t* GenLines, HTuple* Angle, HTuple* Dist) const   ( Windows only)

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)

def hough_lines_dir(image_dir: HObject, direction_uncertainty: int, angle_resolution: int, smoothing: str, filter_size: int, threshold: int, angle_gap: int, dist_gap: int, gen_lines: str) -> Tuple[HObject, HObject, Sequence[float], Sequence[float]]

描述

算子 hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirHoughLinesDirhough_lines_dir 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 ImageDirImageDirImageDirImageDirimageDirimage_dir

In contrast to hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines, additionally the edge direction in ImageDirImageDirImageDirImageDirimageDirimage_dir (e.g., returned by sobel_dirsobel_dirSobelDirSobelDirSobelDirsobel_dir or edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image) is taken into account. This results in a more efficient computation and in a reduction of the noise in the Hough space.

The parameter DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty describes how much the edge direction of the individual points within a line is allowed to vary. For example, with DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty = 10 a horizontal line (i.e., edge direction = 0 degrees) may contain points with an edge direction between -10 and +10 degrees. The higher DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty is chosen, the higher the computation time will be. For DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty = 180 hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirHoughLinesDirhough_lines_dir shows the same behavior as hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines, i.e., the edge direction is ignored. DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty should be chosen at least as high as the step width of the edge direction stored in ImageDirImageDirImageDirImageDirimageDirimage_dir. The minimum step width is 2 degrees (defined by the image type 'direction').

The parameter AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution defines how accurately the angles are determined. The accuracy amounts to 1 / AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution degrees. A subsequent smoothing of the Hough space results in an increased stability. The smoothing filter can be selected by SmoothingSmoothingSmoothingSmoothingsmoothingsmoothing, the degree of smoothing by the parameter FilterSizeFilterSizeFilterSizeFilterSizefilterSizefilter_size (see mean_imagemean_imageMeanImageMeanImageMeanImagemean_image or gauss_imagegauss_imageGaussImageGaussImageGaussImagegauss_image for details). The parameter ThresholdThresholdThresholdThresholdthresholdthreshold 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 AngleGapAngleGapAngleGapAngleGapangleGapangle_gap and DistGapDistGapDistGapDistGapdistGapdist_gap define a neighborhood of the points in the Hough image in order to determine the local maxima: AngleGapAngleGapAngleGapAngleGapangleGapangle_gap describes the minimum distance of two maxima in the Hough image in angle direction and DistGapDistGapDistGapDistGapdistGapdist_gap in distance direction, respectively. Thus, maxima exceeding ThresholdThresholdThresholdThresholdthresholdthreshold but lying close to an even higher maximum are eliminated. If multiple maxima in this neighborhood are equally high, all of them are returned. This elimination can particularly be helpful when searching for short and long lines simultaneously. Besides the not smoothed Hough image HoughImageHoughImageHoughImageHoughImagehoughImagehough_image, the lines are returned in Hessian Normal Form (HNF), that is by the direction AngleAngleAngleAngleangleangle and length DistDistDistDistdistdist of their normal vectors. If the parameter GenLinesGenLinesGenLinesGenLinesgenLinesgen_lines is set to 'true'"true""true""true""true""true", additionally those regions in ImageDirImageDirImageDirImageDirimageDirimage_dir are returned that contributed to the local maxima in Hough space. They are stored in the parameter LinesLinesLinesLineslineslines

执行信息

参数

ImageDirImageDirImageDirImageDirimageDirimage_dir (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (direction)

Image containing the edge direction. The edges are described by the image domain.

HoughImageHoughImageHoughImageHoughImagehoughImagehough_image (输出对象)  image objectHImageHObjectHImageHobject * (uint2)

Hough transform.

LinesLinesLinesLineslineslines (输出对象)  region-array objectHRegionHObjectHRegionHobject *

Regions of the input image that contributed to the local maxima.

DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty (输入控制)  angle.deg HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Uncertainty of edge direction (in degrees).

默认值: 2

值范围: 2 ≤ DirectionUncertainty DirectionUncertainty DirectionUncertainty DirectionUncertainty directionUncertainty direction_uncertainty ≤ 180

最小增量: 2

AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Resolution in the angle area (in 1/degrees).

默认值: 4

值列表: 1, 2, 4, 8

SmoothingSmoothingSmoothingSmoothingsmoothingsmoothing (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Smoothing filter for hough image.

默认值: 'mean' "mean" "mean" "mean" "mean" "mean"

值列表: 'gauss'"gauss""gauss""gauss""gauss""gauss", 'mean'"mean""mean""mean""mean""mean", 'none'"none""none""none""none""none"

FilterSizeFilterSizeFilterSizeFilterSizefilterSizefilter_size (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Required smoothing filter size.

默认值: 5

值列表: 3, 5, 7, 9, 11

ThresholdThresholdThresholdThresholdthresholdthreshold (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Threshold value in the Hough image.

默认值: 100

值范围: 1 ≤ Threshold Threshold Threshold Threshold threshold threshold

AngleGapAngleGapAngleGapAngleGapangleGapangle_gap (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum distance of two maxima in the Hough image (direction: angle).

默认值: 5

值范围: 0 ≤ AngleGap AngleGap AngleGap AngleGap angleGap angle_gap

DistGapDistGapDistGapDistGapdistGapdist_gap (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum distance of two maxima in the Hough image (direction: distance).

默认值: 5

值范围: 0 ≤ DistGap DistGap DistGap DistGap distGap dist_gap

GenLinesGenLinesGenLinesGenLinesgenLinesgen_lines (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Create line regions if 'true'"true""true""true""true""true".

默认值: 'true' "true" "true" "true" "true" "true"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

AngleAngleAngleAngleangleangle (输出控制)  hesseline.angle.rad-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Angles (in radians) of the detected lines' normal vectors.

值范围: -1.5707963 ≤ Angle Angle Angle Angle angle angle ≤ 3.1415927

DistDistDistDistdistdist (输出控制)  hesseline.distance-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Distance of the detected lines from the origin.

元素数量: Dist == Angle

值范围: 0 ≤ Dist Dist Dist Dist dist dist

结果

The operator hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines returns the value 2 ( H_MSG_TRUE) if the input is not empty. 当输入为空(无可用输入区域)时,可设置行为通过算子 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image, sobel_dirsobel_dirSobelDirSobelDirSobelDirsobel_dir, thresholdthresholdThresholdThresholdThresholdthreshold, nonmax_suppression_dirnonmax_suppression_dirNonmaxSuppressionDirNonmaxSuppressionDirNonmaxSuppressionDirnonmax_suppression_dir, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, skeletonskeletonSkeletonSkeletonSkeletonskeleton

可能的后继

gen_region_hlinegen_region_hlineGenRegionHlineGenRegionHlineGenRegionHlinegen_region_hline, select_matching_linesselect_matching_linesSelectMatchingLinesSelectMatchingLinesSelectMatchingLinesselect_matching_lines

另见

hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirHoughLineTransDirhough_line_trans_dir, hough_line_transhough_line_transHoughLineTransHoughLineTransHoughLineTranshough_line_trans, gen_region_hlinegen_region_hlineGenRegionHlineGenRegionHlineGenRegionHlinegen_region_hline, hough_circleshough_circlesHoughCirclesHoughCirclesHoughCircleshough_circles

模块

基础