hough_linesT_hough_linesHoughLinesHoughLineshough_lines(算子)

名称

hough_linesT_hough_linesHoughLinesHoughLineshough_lines — 在霍夫变换的帮助下检测边缘图像中的线,并以 HNF 格式返回。

签名

hough_lines(RegionIn : : AngleResolution, Threshold, AngleGap, DistGap : Angle, Dist)

Herror T_hough_lines(const Hobject RegionIn, const Htuple AngleResolution, const Htuple Threshold, const Htuple AngleGap, const Htuple DistGap, Htuple* Angle, Htuple* Dist)

void HoughLines(const HObject& RegionIn, const HTuple& AngleResolution, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, HTuple* Angle, HTuple* Dist)

HTuple HRegion::HoughLines(Hlong AngleResolution, Hlong Threshold, Hlong AngleGap, Hlong DistGap, HTuple* Dist) const

static void HOperatorSet.HoughLines(HObject regionIn, HTuple angleResolution, HTuple threshold, HTuple angleGap, HTuple distGap, out HTuple angle, out HTuple dist)

HTuple HRegion.HoughLines(int angleResolution, int threshold, int angleGap, int distGap, out HTuple dist)

def hough_lines(region_in: HObject, angle_resolution: int, threshold: int, angle_gap: int, dist_gap: int) -> Tuple[Sequence[float], Sequence[float]]

描述

算子 hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines allows the selection of linelike structures in a region, whereby it is not necessary that the individual points of a line are connected. This process is based on the Hough transform.

The parameter AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution defines the degree of exactness concerning the determination of the angles. It amounts to 1 / AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution degree. 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. The lines are returned in Hessian Normal Form (HNF), that is by the direction AngleAngleAngleAngleangleangle and length DistDistDistDistdistdist of their normal vectors.

执行信息

参数

RegionInRegionInRegionInRegionInregionInregion_in (输入对象)  region objectHRegionHObjectHRegionHobject

Binary edge image in which the lines are to be detected.

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

Adjusting the resolution in the angle area.

默认值: 4

值列表: 1, 2, 4, 8

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

Threshold value in the Hough image.

默认值: 100

值范围: 2 ≤ Threshold Threshold Threshold Threshold threshold threshold

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

Minimal 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)

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

默认值: 5

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

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

结果

算子 hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines 在输入不为空时返回值 2 ( H_MSG_TRUE )。当输入为空(无可用输入区域)时,可设置行为通过算子 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>), the behavior in case of empty region is set via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, skeletonskeletonSkeletonSkeletonSkeletonskeleton

可能的后继

select_matching_linesselect_matching_linesSelectMatchingLinesSelectMatchingLinesSelectMatchingLinesselect_matching_lines

另见

hough_line_transhough_line_transHoughLineTransHoughLineTransHoughLineTranshough_line_trans, gen_region_hlinegen_region_hlineGenRegionHlineGenRegionHlineGenRegionHlinegen_region_hline, hough_circleshough_circlesHoughCirclesHoughCirclesHoughCircleshough_circles

模块

基础