MpatGetNumber()函数

Synopsis

Get the number of model occurrences in the target image.

Format

long MpatGetNumber(PatResultId, CountPtr)

MIL_ID PatResultId; Pattern matching result buffer identifier
long *CountPtr; Storage location for the count

Description

This function is used to determine the number of matches found after searching for a model. It returns the number of occurrences of the model that were found with match scores equal to or above the model’s acceptance level. This number is the number of results that will be retrieved when you call MpatGetResult.

A call to MpatGetNumber should be made prior to checking any results with MpatGetResult; in the case that no occurrences of the model were found, there would be no need to check the results. Also, the returned number will never be bigger than the number of entries allocated in the result buffer; it is up to you to make sure you don’t search for more matches than will fit in the result buffer. If you search for all occurrences (M_ALL) and the result buffer is too small, MpatFind…() (MpatFindModel, MpatFindMultipleModel, MpatFindOrientation) will return an error indicating that the buffer has overflowed.

The PatResultId parameter specifies the identifier of the pattern recognition result buffer that was used to store results obtained by MpatFindModel, MpatFindMultipleModel or MpatFindOrientation.

The CountPtr parameter specifies the address of the variable in which the number of occurrences is to be written. Since the MpatGetNumber function also returns the requested information, you can set this parameter to M_NULL.

Returned value

The returned value is the number of occurrences of the model that were found at or above the acceptance level.

See also

MpatSetNumber

《MpatGetNumber()函数》上有4条评论

评论已关闭。