Herror ::moments_xld (
    Hobject XLD,
    double *M11,
    double *M20,
    double *M02
)
Herror ::moments_xld (
    Hobject XLD,
    HTuple *M11,
    HTuple *M20,
    HTuple *M02
)

Geometric moments M20, M02, and M11 of contours or polygons.

::moments_xld calculates the moments (M20, M02, and M11) of the region enclosed by the contours or polygons XLD. See ::moments_region_2nd for the definition of these features. The moments are computed by applying Green's theorem using only the points on the contour or polygon, i.e., no region is generated explicitly for the purpose of calculating the features. It is assumed that the contours or polygons are closed. If this is not the case ::moments_xld will add one point to artificially produce a closed shape. If more than one contour or polygon is passed the results are stored as tuples in which the index of a value corresponds to the index of the respective contour or polygon in XLD.


Parameters

XLD (input_object)
xld(-array) -> Hobject: HXLD(Array)
Contours or polygons to be examined.

M11 (output_control)
real(-array) -> (HTuple.) double *
Mixed second order moment.

M20 (output_control)
real(-array) -> (HTuple.) double *
Second order moment along the row axis.

M02 (output_control)
real(-array) -> (HTuple.) 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_xld returns H_MSG_TRUE if the input is not empty. If the input is empty the behaviour can be set via ::set_system('no_object_result',<Result>). If necessary, an exception is raised.


Possible Predecessors

::gen_contours_skeleton_xld, ::smooth_contours_xld, ::gen_polygons_xld


Alternatives

::moments_any_xld


See also

::moments_any_xld, ::area_center_xld, ::moments_region_2nd, ::area_center


Module

Sub-pixel operators



Copyright © 1996-2002 MVTec Software GmbH