MIL_ID FeatureListId, | //in |
MIL_INT64 MomType, | //in |
MIL_INT XMomOrder, | //in |
MIL_INT YMomOrder | //in |
This function adds the specified general moment to the feature list. The general moment will be calculated by MblobCalculate(). Moment calculations other than those supported by MblobSelectFeature() must be specified with this function.
After calling MblobCalculate(), you can retrieve the results of the specified moment using MblobGetResult() or MblobGetResultSingle(), with M_GENERAL_MOMENT as the feature. Moments that you can add for calculation using MblobSelectFeature() (for example, M_MOMENT_X0_Y2) are calculated faster than if you selected them through MblobSelectMoment().
A call to this function overrides any previous values specified for M_GENERAL_MOMENT in the feature list.
Specifies the moment type. 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.
This parameter must be set to one of the following values:
For specifying the moment
type
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CENTRAL + |
Specifies a central moment. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ORDINARY + |
Specifies an ordinary moment. (more details...) |
You can add one of the following values to the above-mentioned values to set whether to use the binary or grayscale version of the selected feature.
If you provide a grayscale image, both grayscale and binary versions are calculated. The following limits the results to either binary or grayscale.
For specifying one version of the
results
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_BINARY |
Calculates only the binary version of the image. |
||||||||||||||||||||||||||||||||||||||
M_GRAYSCALE |
Calculates only the grayscale version of the image. |
You can add one of the following values to the above-mentioned values to set the general moment as a sorting key for the result retrieval.
For selecting a sorting key
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NO_SORT |
Removes the specified sorting key. |
||||||||||||||||||||||||||||||||||||||
M_SORTn_DOWN |
Specifies the feature as the n th sorting key (in descending order), where n stands for an integer between 1 and 3. |
||||||||||||||||||||||||||||||||||||||
M_SORTn_UP |
Specifies the feature as the n th sorting key (in ascending order), where n stands for an integer between 1 and 3. |
Header | Include mil.h. |
Library | Use mil.lib; milblob.lib. |
DLL | Requires mil.dll; milblob.dll. |