hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dir (Operator)

Name

hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dir — Compute the Hough transform for lines using local gradient direction.

Signature

hough_line_trans_dir(ImageDir : HoughImage : DirectionUncertainty, AngleResolution : )

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)

void HoughLineTransDir(const HObject& ImageDir, HObject* HoughImage, const HTuple& DirectionUncertainty, const HTuple& AngleResolution)

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

static void HOperatorSet.HoughLineTransDir(HObject imageDir, out HObject houghImage, HTuple directionUncertainty, HTuple angleResolution)

HImage HImage.HoughLineTransDir(int directionUncertainty, int angleResolution)

def hough_line_trans_dir(image_dir: HObject, direction_uncertainty: int, angle_resolution: int) -> HObject

Description

The operator hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dir calculates the Hough transform for lines in those regions passed in the domain of ImageDirImageDirImageDirimageDirimage_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_transhough_line_transHoughLineTransHoughLineTranshough_line_trans, additionally the edge direction in ImageDirImageDirImageDirimageDirimage_dir (e.g., returned by sobel_dirsobel_dirSobelDirSobelDirsobel_dir or edges_imageedges_imageEdgesImageEdgesImageedges_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 DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty describes how much the edge direction of the individual points within a line is allowed to vary. For example, with DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_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 DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty is chosen, the higher the computation time will be. For DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty = 180 hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dir shows the same behavior as hough_line_transhough_line_transHoughLineTransHoughLineTranshough_line_trans, i.e., the edge direction is ignored. DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty should be chosen at least as high as the step width of the edge direction stored in ImageDirImageDirImageDirimageDirimage_dir. The minimum step width is 2 degrees (defined by the image type 'direction').

The result is stored in a newly generated UINT2-Image (HoughImageHoughImageHoughImagehoughImagehough_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 / AngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution, which means that one pixel in x-direction is equivalent to 1 / AngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution degrees and that the HoughImageHoughImageHoughImagehoughImagehough_image has a width of 270 * AngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution + 1 pixels. The height of the HoughImageHoughImageHoughImagehoughImagehough_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

Parameters

ImageDirImageDirImageDirimageDirimage_dir (input_object)  singlechannelimage objectHImageHObjectHObjectHobject (direction)

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

HoughImageHoughImageHoughImagehoughImagehough_image (output_object)  image objectHImageHObjectHObjectHobject * (uint2)

Hough transform.

DirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty (input_control)  angle.deg HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Uncertainty of the edge direction (in degrees).

Default: 2

Value range: 2 ≤ DirectionUncertainty DirectionUncertainty DirectionUncertainty directionUncertainty direction_uncertainty ≤ 180

Minimum increment: 2

AngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

Default: 4

List of values: 1, 2, 4, 8

Result

The operator hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirhough_line_trans_dir 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>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

edges_imageedges_imageEdgesImageEdgesImageedges_image, sobel_dirsobel_dirSobelDirSobelDirsobel_dir, thresholdthresholdThresholdThresholdthreshold, hysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThresholdhysteresis_threshold, nonmax_suppression_dirnonmax_suppression_dirNonmaxSuppressionDirNonmaxSuppressionDirnonmax_suppression_dir, reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain

Possible Successors

binomial_filterbinomial_filterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFiltergauss_filter, thresholdthresholdThresholdThresholdthreshold, local_maxlocal_maxLocalMaxLocalMaxlocal_max, plateaus_centerplateaus_centerPlateausCenterPlateausCenterplateaus_center

See also

hough_line_transhough_line_transHoughLineTransHoughLineTranshough_line_trans, hough_lineshough_linesHoughLinesHoughLineshough_lines, hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dir

Module

Foundation