Herror ::get_contour_angle_xld (
    Hobject Contour,
    const HTuple &AngleMode,
    const HTuple &CalcMode,
    const HTuple &Lookaround,
    HTuple *Angles
)
HTuple HXLDCont::GetContourAngleXld (
    const HTuple &AngleMode,
    const HTuple &CalcMode,
    const HTuple &Lookaround
) const

Calculate the direction of an XLD contour for each contour point.

::get_contour_angle_xld calculates for each point of the XLD contour Contour the direction of its tangent. Two modes for the output values can be chosen: By passing 'abs' for AngleMode, the resulting angles are returned relative to the horizontal axis as angles between 0 and 2*PI (counter-clockwise). By passing 'rel', the absolute value of the difference of angles to the previous contour point is returned. In this case the range of values is between 0 and PI.

There are three different ways of calculating the tangent direction (CalcMode) of the contour point i using the contour points in the interval from i - Lookaround to i + Lookaround. By using 'range', the angle of the line segment between the first and last point of the interval is used. For 'mean', the average of all angles between consecutive points of the contour is used. Finally, for 'regress', the direction of the regression line (the least squares fit of a line to the contour points in the interval) is used. Lookaround is a measure of how strongly the contour is smoothed. The angles are returned in Angles in radians.


Parameters

Contour (input_object)
xld_cont -> Hobject: HXLDCont
Input contour.

AngleMode (input_control)
string -> HTuple.char *
Return type of the angles.
Default value: 'abs'
List of values: 'abs', 'rel'

CalcMode (input_control)
string -> HTuple.char *
Method for computing the angles.
Default value: 'range'
List of values: 'range', 'mean', 'regress'

Lookaround (input_control)
integer -> HTuple.long
Number of points to take into account.
Default value: 3
Restriction: Lookaround > 0

Angles (output_control)
real-array -> HTuple.double *
Direction of the tangent to the contour points.


Possible Predecessors

::gen_contours_skeleton_xld, ::lines_gauss, ::lines_facet, ::edges_sub_pix


See also

::get_contour_xld, ::get_contour_attrib_xld


Module

Sub-pixel operators



Copyright © 1996-2002 MVTec Software GmbH