ClassesClassesClassesClasses | | | | Operators

moments_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld (Operator)

Name

moments_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld — Geometric moments , , and of contours or polygons treated as point clouds.

Signature

moments_points_xld(XLD : : : M11, M20, M02)

Herror moments_points_xld(const Hobject XLD, double* M11, double* M20, double* M02)

Herror T_moments_points_xld(const Hobject XLD, Htuple* M11, Htuple* M20, Htuple* M02)

Herror moments_points_xld(Hobject XLD, double* M11, double* M20, double* M02)

Herror moments_points_xld(Hobject XLD, HTuple* M11, HTuple* M20, HTuple* M02)

double HXLD::MomentsPointsXld(double* M20, double* M02) const

HTuple HXLDArray::MomentsPointsXld(HTuple* M20, HTuple* M02) const

void MomentsPointsXld(const HObject& XLD, HTuple* M11, HTuple* M20, HTuple* M02)

HTuple HXLD::MomentsPointsXld(HTuple* M20, HTuple* M02) const

double HXLD::MomentsPointsXld(double* M20, double* M02) const

void HOperatorSetX.MomentsPointsXld(
[in] IHUntypedObjectX* XLD, [out] VARIANT* M11, [out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDContX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDPolyX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDParaX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDModParaX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

VARIANT HXLDExtParaX.MomentsPointsXld(
[out] VARIANT* M20, [out] VARIANT* M02)

static void HOperatorSet.MomentsPointsXld(HObject XLD, out HTuple m11, out HTuple m20, out HTuple m02)

HTuple HXLD.MomentsPointsXld(out HTuple m20, out HTuple m02)

double HXLD.MomentsPointsXld(out double m20, out double m02)

Description

moments_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld calculates the moments (M20M20M20M20M20m20, M02M02M02M02M02m02, and M11M11M11M11M11m11) of a point cloud given by a contour or a polygon XLDXLDXLDXLDXLDXLD (i.e., the order of the points in the contour or polygon is not taken into account). Therefore, the moments are given by

Here, is the centroid and n the number of points.

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_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld should be used if the contour XLDXLDXLDXLDXLDXLD 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_xldmoments_xldMomentsXldmoments_xldMomentsXldMomentsXld does not produce useful results. To test whether the contours or polygons intersect themselves, test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld can be used.

If more than one contour or polygon is passed, the results are stored in tuples in the same order as the respective contours or polygons in XLDXLDXLDXLDXLDXLD.

Parallelization

Parameters

XLDXLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHXLDHXLDXHobject

Contours or polygons to be examined.

M11M11M11M11M11m11 (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Mixed second order moment.

M20M20M20M20M20m20 (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Second order moment along the row axis.

M02M02M02M02M02m02 (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Second order moment along the column axis.

Complexity

Let n be the number of points of the contour or polygon. Then the run time is O(n).

Result

moments_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld returns 2 (H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, smooth_contours_xldsmooth_contours_xldSmoothContoursXldsmooth_contours_xldSmoothContoursXldSmoothContoursXld, gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld

Alternatives

moments_xldmoments_xldMomentsXldmoments_xldMomentsXldMomentsXld, moments_any_xldmoments_any_xldMomentsAnyXldmoments_any_xldMomentsAnyXldMomentsAnyXld, moments_any_points_xldmoments_any_points_xldMomentsAnyPointsXldmoments_any_points_xldMomentsAnyPointsXldMomentsAnyPointsXld

See also

moments_any_points_xldmoments_any_points_xldMomentsAnyPointsXldmoments_any_points_xldMomentsAnyPointsXldMomentsAnyPointsXld, area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld, moments_region_2ndmoments_region_2ndMomentsRegion2ndmoments_region_2ndMomentsRegion2ndMomentsRegion2nd, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter

Module

Foundation


ClassesClassesClassesClasses | | | | Operators