Skip to content

hough_linesHoughLinesHoughLineshough_linesT_hough_linesπŸ”—

Short descriptionπŸ”—

hough_linesHoughLinesHoughLineshough_linesT_hough_lines β€” Detect lines in edge images with the help of the Hough transform and returns it in HNF.

SignatureπŸ”—

hough_lines( region RegionIn, integer AngleResolution, integer Threshold, integer AngleGap, integer DistGap, out hesseline.angle.rad Angle, out hesseline.distance Dist )void HoughLines( const HObject& RegionIn, const HTuple& AngleResolution, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, HTuple* Angle, HTuple* Dist )static void HOperatorSet.HoughLines( HObject regionIn, HTuple angleResolution, HTuple threshold, HTuple angleGap, HTuple distGap, out HTuple angle, 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]]

Herror T_hough_lines( 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

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

DescriptionπŸ”—

The operator hough_linesHoughLines allows the selection of line-like 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 AngleResolutionangleResolutionangle_resolution defines the degree of exactness concerning the determination of the angles. It amounts to \(1 / \textrm{AngleResolution}\) degree. The parameter Thresholdthresholdthreshold 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 AngleGapangleGapangle_gap and DistGapdistGapdist_gap define a neighborhood of the points in the Hough image in order to determine the local maxima: AngleGapangleGapangle_gap describes the minimum distance of two maxima in the Hough image in angle direction and DistGapdistGapdist_gap in distance direction, respectively. Thus, maxima exceeding Thresholdthresholdthreshold 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 Angleangleangle and length Distdistdist of their normal vectors.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

RegionInregionInregion_in (input_object) region β†’ objectHObjectHRegionHObjectHobject

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

AngleResolutionangleResolutionangle_resolution (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Adjusting the resolution in the angle area.

Default: 44
List of values: 1, 2, 4, 81, 2, 4, 8

Thresholdthresholdthreshold (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Threshold value in the Hough image.

Default: 100100
Value range: 2 ≀ Threshold

AngleGapangleGapangle_gap (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

Default: 55
Value range: 0 ≀ AngleGap

DistGapdistGapdist_gap (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

Default: 55
Value range: 0 ≀ DistGap

Angleangleangle (output_control) hesseline.angle.rad-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

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

Value range: -1.5707963 ≀ Angle ≀ 3.1415927

Distdistdist (output_control) hesseline.distance-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Distance of the detected lines from the origin.

Number of elements: Dist == Angle
Value range: 0 ≀ Dist

ResultπŸ”—

The operator hough_linesHoughLines 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>), the behavior in case of empty region is set via set_system('empty_region_result',<Result>). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

thresholdThreshold, skeletonSkeleton

Possible successors

select_matching_linesSelectMatchingLines

See also

hough_line_transHoughLineTrans, gen_region_hlineGenRegionHline, hough_circlesHoughCircles

ModuleπŸ”—

Foundation