moments_any_points_xld moments_any_points_xld MomentsAnyPointsXld MomentsAnyPointsXld moments_any_points_xld (算子)
名称
moments_any_points_xld moments_any_points_xld MomentsAnyPointsXld MomentsAnyPointsXld moments_any_points_xld — 被视为点云的轮廓或多边形的任意几何矩。
签名
Herror moments_any_points_xld (const Hobject XLD , const char* Mode , double Area , double CenterRow , double CenterCol , const Hlong P , const Hlong Q , double* M )
Herror T_moments_any_points_xld (const Hobject XLD , const Htuple Mode , const Htuple Area , const Htuple CenterRow , const Htuple CenterCol , const Htuple P , const Htuple Q , Htuple* M )
void MomentsAnyPointsXld (const HObject& XLD , const HTuple& Mode , const HTuple& Area , const HTuple& CenterRow , const HTuple& CenterCol , const HTuple& P , const HTuple& Q , HTuple* M )
HTuple HXLD ::MomentsAnyPointsXld (const HString& Mode , const HTuple& Area , const HTuple& CenterRow , const HTuple& CenterCol , const HTuple& P , const HTuple& Q ) const
double HXLD ::MomentsAnyPointsXld (const HString& Mode , double Area , double CenterRow , double CenterCol , Hlong P , Hlong Q ) const
double HXLD ::MomentsAnyPointsXld (const char* Mode , double Area , double CenterRow , double CenterCol , Hlong P , Hlong Q ) const
double HXLD ::MomentsAnyPointsXld (const wchar_t* Mode , double Area , double CenterRow , double CenterCol , Hlong P , Hlong Q ) const
(
Windows only)
static void HOperatorSet .MomentsAnyPointsXld (HObject XLD , HTuple mode , HTuple area , HTuple centerRow , HTuple centerCol , HTuple p , HTuple q , out HTuple m )
HTuple HXLD .MomentsAnyPointsXld (string mode , HTuple area , HTuple centerRow , HTuple centerCol , HTuple p , HTuple q )
double HXLD .MomentsAnyPointsXld (string mode , double area , double centerRow , double centerCol , int p , int q )
def moments_any_points_xld (xld : HObject, mode : str, area : MaybeSequence[float], center_row : MaybeSequence[float], center_col : MaybeSequence[float], p : MaybeSequence[int], q : MaybeSequence[int]) -> Sequence[float]
def moments_any_points_xld_s (xld : HObject, mode : str, area : MaybeSequence[float], center_row : MaybeSequence[float], center_col : MaybeSequence[float], p : MaybeSequence[int], q : MaybeSequence[int]) -> float
描述
moments_any_points_xld moments_any_points_xld MomentsAnyPointsXld MomentsAnyPointsXld MomentsAnyPointsXld moments_any_points_xld calculates arbitrary moments
M M M M m m of the point clouds given by the contours or polygons
XLD XLD XLD XLD XLD xld (i.e., the order of the points in the contour or
polygon is not taken into account).
The computed moments are normalized depending on the desired mode
Mode Mode Mode Mode mode mode :
'unnormalized':
No normalization.
The computed moment
is:
'unnormalized_central':
Shift the contour points by their centroid
= [CenterRow CenterRow CenterRow CenterRow centerRow center_row , CenterCol CenterCol CenterCol CenterCol centerCol center_col ]:
'normalized':
Normalization by the area A = Area Area Area Area area area
from XLD XLD XLD XLD XLD xld :
'central':
Normalization by the area A = Area Area Area Area area area
and a shift of the contour points by their centroid
= [CenterRow CenterRow CenterRow CenterRow centerRow center_row , CenterCol CenterCol CenterCol CenterCol centerCol center_col ]:
For the normalization of the moments three specific values are
used: The area Area Area Area Area area area and the coordinates
CenterRow CenterRow CenterRow CenterRow centerRow center_row ,CenterCol CenterCol CenterCol CenterCol centerCol center_col of it's centroid (this values can be
computed with area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld ).
If the contour or polygon is closed (end point = start point), the end point
of the contour or polygon is not taken into account to avoid that it receives
twice the weight of the other points.
moments_any_xld moments_any_xld MomentsAnyXld MomentsAnyXld MomentsAnyXld moments_any_xld should be used if the contour XLD XLD XLD XLD XLD xld
intersects itself or if it is not possible to close the contour using a line
from end to start point without self-intersection, because in this case
moments_any_xld moments_any_xld MomentsAnyXld MomentsAnyXld MomentsAnyXld moments_any_xld does not produce useful results.可使用 test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld 检测轮廓或多边形是否自相交。
If more than one contour or polygon is passed, M M M M m m contains
all desired moments of the first contour/polygon followed by all the
moments of the second contour/polygon and so forth.
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
未采用并行化处理。
参数
XLD XLD XLD XLD XLD xld (输入对象) xld(-array) → object HXLD HObject HXLD Hobject
待检查的轮廓或多边形。
Mode Mode Mode Mode mode mode (输入控制) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Computation mode.
默认值:
'unnormalized'
"unnormalized"
"unnormalized"
"unnormalized"
"unnormalized"
"unnormalized"
建议值:
'unnormalized' "unnormalized" "unnormalized" "unnormalized" "unnormalized" "unnormalized" , 'unnormalized_central' "unnormalized_central" "unnormalized_central" "unnormalized_central" "unnormalized_central" "unnormalized_central" , 'normalized' "normalized" "normalized" "normalized" "normalized" "normalized" , 'central' "central" "central" "central" "central" "central"
Area Area Area Area area area (输入控制) real(-array) → HTuple MaybeSequence[float] HTuple Htuple (real) (double ) (double ) (double )
由轮廓或多边形包围的面积。
CenterRow CenterRow CenterRow CenterRow centerRow center_row (输入控制) point.y(-array) → HTuple MaybeSequence[float] HTuple Htuple (real) (double ) (double ) (double )
质心的行坐标。
CenterCol CenterCol CenterCol CenterCol centerCol center_col (输入控制) point.x(-array) → HTuple MaybeSequence[float] HTuple Htuple (real) (double ) (double ) (double )
质心的列坐标。
P P P P p p (输入控制) point.x(-array) → HTuple MaybeSequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
First index of the desired moments
。
默认值:
1
建议值:
0, 1, 2, 3, 4
Q Q Q Q q q (输入控制) point.x(-array) → HTuple MaybeSequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Second index of the desired moments
。
默认值:
1
建议值:
0, 1, 2, 3, 4
M M M M m m (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
The computed moments.
复杂度
设 n 为轮廓或多边形的点数。则运行时间为 O(n)。
结果
moments_any_points_xld moments_any_points_xld MomentsAnyPointsXld MomentsAnyPointsXld MomentsAnyPointsXld moments_any_points_xld 在输入不为空时返回 2 ( H_MSG_TRUE )。如果输入为空则可设置行为通过 set_system(::'no_object_result',<Result>:) set_system("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) set_system("no_object_result",<Result>) 。如有必要,则抛出异常。
可能的前趋
area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld ,
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld GenContoursSkeletonXld gen_contours_skeleton_xld ,
smooth_contours_xld smooth_contours_xld SmoothContoursXld SmoothContoursXld SmoothContoursXld smooth_contours_xld ,
gen_polygons_xld gen_polygons_xld GenPolygonsXld GenPolygonsXld GenPolygonsXld gen_polygons_xld
替代
moments_points_xld moments_points_xld MomentsPointsXld MomentsPointsXld MomentsPointsXld moments_points_xld ,
moments_any_xld moments_any_xld MomentsAnyXld MomentsAnyXld MomentsAnyXld moments_any_xld
另见
moments_points_xld moments_points_xld MomentsPointsXld MomentsPointsXld MomentsPointsXld moments_points_xld ,
area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld ,
moments_region_2nd moments_region_2nd MomentsRegion2nd MomentsRegion2nd MomentsRegion2nd moments_region_2nd ,
area_center area_center AreaCenter AreaCenter AreaCenter area_center
模块
基础