Skip to content

hough_line_transhough_line_transHoughLineTransHoughLineTranshough_line_transhough_line_transπŸ”—

Short descriptionπŸ”—

hough_line_transhough_line_transHoughLineTransHoughLineTranshough_line_transhough_line_trans β€” Produce the Hough transform for lines within regions.

SignatureπŸ”—

hough_line_trans( region Region, out image HoughImage, integer AngleResolution )hough_line_trans( Region : HoughImage : AngleResolution : )void HoughLineTrans( const HObject& Region, HObject* HoughImage, const HTuple& AngleResolution )static void HOperatorSet.HoughLineTrans( HObject region, out HObject houghImage, HTuple angleResolution )def hough_line_trans( region: HObject, angle_resolution: int ) -> HObject

Herror hough_line_trans( const Hobject Region, Hobject* HoughImage, const Hlong AngleResolution )

Herror T_hough_line_trans( const Hobject Region, Hobject* HoughImage, const Htuple AngleResolution )

HImage HRegion::HoughLineTrans( Hlong AngleResolution ) const

HImage HRegion.HoughLineTrans( int angleResolution )

DescriptionπŸ”—

The operator hough_line_transHoughLineTrans calculates the Hough transform for lines in those regions transmitted by Regionregionregion. Thereby the angles and the lengths of the lines’ normal vectors are registered in the parameter space (the Hough- or accumulator space respectively). This means that the parametrization is executed according to the HNF.

The result is registered in a newly generated Int2-Image (HoughImagehoughImagehough_image), whereby the x-axis is equivalent to the angle between the normal vector and the x-axis (in the original image), and the y-axis is equivalent to the distance of the line from the origin.

The angle ranges from -90 to 180 degrees and will be registered with a resolution of \(1 / \textrm{AngleResolution}\), which means that one pixel in x-direction is equivalent to \(1 / \textrm{AngleResolution}\) and that the HoughImagehoughImagehough_image has a width of \(270 * \textrm{AngleResolution} + 1\) pixel. The height of the HoughImagehoughImagehough_image corresponds to the distance between the lower right corner of the surrounding rectangle of the input region and the origin.

The maxima in the result image are equivalent to the parameter values of the lines in the original image.

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πŸ”—

Regionregionregion (input_object) region β†’ objectobjectHObjectHRegionHObjectHobject

Binary edge image in which lines are to be detected.

HoughImagehoughImagehough_image (output_object) image β†’ object (int2)object (int2)HObject (int2)HImage (int2)HObject (int2)Hobject * (int2)

Hough transform for lines.

AngleResolutionangleResolutionangle_resolution (input_control) integer β†’ (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

ResultπŸ”—

The operator hough_line_transHoughLineTrans 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

thresholdThreshold, local_maxLocalMax

See also

hough_circle_transHoughCircleTrans, gen_region_hlineGenRegionHline

ModuleπŸ”—

Foundation