The row-dependent moment of 2nd order is returned in M20M20M20m20m20
and the column-dependent moment of 2nd order is returned in M02M02M02m02m02.
The moment M11M11M11m11m11 represents the covariance between
the row and column coordinates of the region points.
Calculation:
and are the coordinates
of the center of gravity of a region R.
Then the moments are defined by:
wherein r and c run over all pixels of the region R.
Furthermore the length of the major and minor axes are defined by:
wherein is defined by:
The equation for the major and minor axes can be derived from the definition
of the moments by diagonalizing the covariance matrix and reforming the resulting
formula.
If more than one region is passed, the results are returned in tuples.
The index of a tuple element corresponds to the index of the respective
input region.
If F is the area of the region the mean runtime
complexity is O(sqrt(F)).
Result
The operator moments_region_2ndmoments_region_2ndMomentsRegion2ndMomentsRegion2ndmoments_region_2nd returns the value 2 (
H_MSG_TRUE)
if the input is not empty.
The behavior in case of empty input (no input regions available) is
set via the operator set_system('no_object_result',<Result>).
The behavior in case of empty region (region is the empty set) is set via
set_system('empty_region_result',<Result>).
If necessary an exception is raised.