MblobSelectMoment()函数

Synopsis

Add specified moment to the feature list.

Format

void MblobSelectMoment(FeatureListId, MomType, XMomOrder, YMomOrder)

MIL_ID FeatureListId; Feature list identifier
long MomType; Moment type
long XMomOrder; X order of the moment (must be greater than or equal to 0)
long YMomOrder; Y order of the moment (must be greater than or equal to 0)

Description

Moment calculations other than those supported by MblobSelectFeature must be specified with this function. This function adds the general moment with the specified parameters to the feature list. The general moment will be calculated by MblobCalculate. Results for this calculation can be obtained by using MblobGetResult or MblobGetResultSingle, specifying M_GENERAL_MOMENT as the feature. Moments directly supported directly by MblobSelectFeature (for example, M_MOMENT_X0_Y2) are calculated faster by selecting them through that function.

The FeatureListId parameter specifies the identifier of the feature list buffer.

The MomType parameter specifies the moment type, either M_CENTRAL or M_ORDINARY. If the calculation is done on a binary image, only a binary version of the result is calculated. If you provide a grayscale image, both grayscale and binary versions are calculated. However, if you want only one specific version of the results, you can combine the selected moment with M_BINARY or M_GRAYSCALE.

The XMomOrder and YMomOrder parameters specify, respectively, the X and Y order of the moment.

A call to this function overrides any previous values specified for M_GENERAL_MOMENT in the feature list.

See also

MblobSelectFeature, MblobCalculate, MblobGetResult, MblobGetResultSingle