Skip to content

hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dirhough_line_trans_dirπŸ”—

Short descriptionπŸ”—

hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dirhough_line_trans_dir β€” Compute the Hough transform for lines using local gradient direction.

SignatureπŸ”—

hough_line_trans_dir( image ImageDir, out image HoughImage, angle.deg DirectionUncertainty, integer AngleResolution )hough_line_trans_dir( ImageDir : HoughImage : DirectionUncertainty, AngleResolution : )void HoughLineTransDir( const HObject& ImageDir, HObject* HoughImage, const HTuple& DirectionUncertainty, const HTuple& AngleResolution )static void HOperatorSet.HoughLineTransDir( HObject imageDir, out HObject houghImage, HTuple directionUncertainty, HTuple angleResolution )def hough_line_trans_dir( image_dir: HObject, direction_uncertainty: int, angle_resolution: int ) -> HObject

Herror hough_line_trans_dir( const Hobject ImageDir, Hobject* HoughImage, const Hlong DirectionUncertainty, const Hlong AngleResolution )

Herror T_hough_line_trans_dir( const Hobject ImageDir, Hobject* HoughImage, const Htuple DirectionUncertainty, const Htuple AngleResolution )

HImage HImage::HoughLineTransDir( Hlong DirectionUncertainty, Hlong AngleResolution ) const

HImage HImage.HoughLineTransDir( int directionUncertainty, int angleResolution )

DescriptionπŸ”—

The operator hough_line_trans_dirHoughLineTransDir calculates the Hough transform for lines in those regions passed in the domain of ImageDirimageDirimage_dir. To do so, the angles and the lengths of the lines’ normal vectors are registered in the parameter space (the so-called Hough or accumulator space).

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

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

The result is stored in a newly generated UINT2-Image (HoughImagehoughImagehough_image), where the x-axis (i.e., columns) represents the angle between the normal vector and the x-axis of the original image, and the y-axis (i.e., rows) represents the distance of the line from the origin.

The angle ranges from -90 to 180 degrees and will be stored with a resolution of \(1 / \textrm{AngleResolution}\), which means that one pixel in x-direction is equivalent to \(1 / \textrm{AngleResolution}\) degrees and that the HoughImagehoughImagehough_image has a width of \(270 * \textrm{AngleResolution} + 1\) pixels. 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 local 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πŸ”—

ImageDirimageDirimage_dir (input_object) singlechannelimage β†’ object (direction)object (direction)HObject (direction)HImage (direction)HObject (direction)Hobject (direction)

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

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

Hough transform.

DirectionUncertaintydirectionUncertaintydirection_uncertainty (input_control) angle.deg β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Uncertainty of the edge direction (in degrees).

Default: 22
Value range: 2 ≀ DirectionUncertainty ≀ 180
Minimum increment: 2

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

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

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

ResultπŸ”—

The operator hough_line_trans_dirHoughLineTransDir returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input is set via the operator set_system('no_object_result',<Result>). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

edges_imageEdgesImage, sobel_dirSobelDir, thresholdThreshold, hysteresis_thresholdHysteresisThreshold, nonmax_suppression_dirNonmaxSuppressionDir, reduce_domainReduceDomain

Possible successors

binomial_filterBinomialFilter, gauss_filterGaussFilter, thresholdThreshold, local_maxLocalMax, plateaus_centerPlateausCenter

See also

hough_line_transHoughLineTrans, hough_linesHoughLines, hough_lines_dirHoughLinesDir

ModuleπŸ”—

Foundation