get_contour_angle_xldT_get_contour_angle_xldGetContourAngleXldGetContourAngleXldget_contour_angle_xld (算子)

名称

get_contour_angle_xldT_get_contour_angle_xldGetContourAngleXldGetContourAngleXldget_contour_angle_xld — 计算每个轮廓点的 XLD 轮廓的方向。

签名

get_contour_angle_xld(Contour : : AngleMode, CalcMode, Lookaround : Angles)

Herror T_get_contour_angle_xld(const Hobject Contour, const Htuple AngleMode, const Htuple CalcMode, const Htuple Lookaround, Htuple* Angles)

void GetContourAngleXld(const HObject& Contour, const HTuple& AngleMode, const HTuple& CalcMode, const HTuple& Lookaround, HTuple* Angles)

HTuple HXLDCont::GetContourAngleXld(const HString& AngleMode, const HString& CalcMode, Hlong Lookaround) const

HTuple HXLDCont::GetContourAngleXld(const char* AngleMode, const char* CalcMode, Hlong Lookaround) const

HTuple HXLDCont::GetContourAngleXld(const wchar_t* AngleMode, const wchar_t* CalcMode, Hlong Lookaround) const   ( Windows only)

static void HOperatorSet.GetContourAngleXld(HObject contour, HTuple angleMode, HTuple calcMode, HTuple lookaround, out HTuple angles)

HTuple HXLDCont.GetContourAngleXld(string angleMode, string calcMode, int lookaround)

def get_contour_angle_xld(contour: HObject, angle_mode: str, calc_mode: str, lookaround: int) -> Sequence[float]

描述

get_contour_angle_xldget_contour_angle_xldGetContourAngleXldGetContourAngleXldGetContourAngleXldget_contour_angle_xld calculates for each point of the XLD contour ContourContourContourContourcontourcontour the direction of its tangent. Two modes for the output values can be chosen: By passing 'abs'"abs""abs""abs""abs""abs" for AngleModeAngleModeAngleModeAngleModeangleModeangle_mode, the resulting angles are returned relative to the horizontal axis as angles between 0 and (counter-clockwise). By passing 'rel'"rel""rel""rel""rel""rel", the angle difference to the previous contour point is returned. In this case the range of values is between and , where negative values indicate a right turn and positive values indicate a left turn.

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

Due to the interval given by LookaroundLookaroundLookaroundLookaroundlookaroundlookaround, the input contour must have at least points. This minimum number of points is required so that the operator always delivers reasonable output values for the different parameter settings.

执行信息

参数

ContourContourContourContourcontourcontour (输入对象)  xld_cont objectHXLDContHObjectHXLDContHobject

Input contour.

AngleModeAngleModeAngleModeAngleModeangleModeangle_mode (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Return type of the angles.

默认值: 'abs' "abs" "abs" "abs" "abs" "abs"

值列表: 'abs'"abs""abs""abs""abs""abs", 'rel'"rel""rel""rel""rel""rel"

CalcModeCalcModeCalcModeCalcModecalcModecalc_mode (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Method for computing the angles.

默认值: 'range' "range" "range" "range" "range" "range"

值列表: 'mean'"mean""mean""mean""mean""mean", 'range'"range""range""range""range""range", 'regress'"regress""regress""regress""regress""regress"

LookaroundLookaroundLookaroundLookaroundlookaroundlookaround (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of points to take into account.

默认值: 3

限制: Lookaround > 0

AnglesAnglesAnglesAnglesanglesangles (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Direction of the tangent to the contour points.

可能的前趋

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld, lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss, lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix

另见

get_contour_xldget_contour_xldGetContourXldGetContourXldGetContourXldget_contour_xld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld

模块

基础