MpatSetSearchParameter()函数

Synopsis

Set a pattern matching internal search parameter.

Format

void MpatSetSearchParameter(ModelId, Parameter, Value)

MIL_ID ModelId; Identifier of model to be affected
long Parameter; Parameter to be set
double Value; Value to set parameter to

Description

This function is for advanced users of the pattern matching module. It need not be used under most circumstances because the default settings usually provide the best results for search operations. However, if the default values do not satisfy the requirements of your application, this function can be used to set the model’s internal search parameters. These internal search parameters are normally derived from the speed and accuracy settings (see MpatSetSpeed and MpatSetAccuracy), but this function gives the experienced user precise control over them.

The ModelId parameter specifies the identifier of the model whose search parameter should be changed.

The Parameter specifies the search parameter to set.

The Value parameter specifies the value to which to set the specified parameter.

The following table lists the search parameters that can be set with this function and their possible values:

Parameter Values Description
M_FIRST_LEVEL 0 – 7 Resolution level for the initial stage of the search.
M_DEFAULT Determine first level automatically.
Note: Level 0 is the original target image, and each higher level is half the size (and resolution) of the previous one. If the specified level does not exist, the highest available level will be used. A higher first level speeds up the initial search but makes it less reliable, because the model may not retain enough distinctive features at such a low resolution.
M_LAST_LEVEL 0 – 7 Resolution level for the final stage of the search.
M_DEFAULT Determine the last level automatically.
Note: If the specified level does not exist, the highest available level will be used. A higher last level reduces search time but also reduces positional accuracy. Search score may also be less reliable for levels above 0, depending on the characteristics of the model. Specify a bottom level of 0 for roughly 1/8 pixel accuracy, a level of 1 for 1/4 pixel accuracy, and a level of 2 for 1/2 pixel accuracy.
M_MODEL_STEP 1 or 2 Use all or every second model pixel in the high resolution stage of the search.
M_DEFAULT Determine the model step automatically.
Note: When the model step is set to 1, all model pixels are used in the correlation. When set to 2, only every second model pixel (in both the X and Y directions) are used. This speeds up the last (high resolution) stage of the search, particularly for large models. The match score may be affected if the model has many fine features, but will tend not to be affected if the model has mainly coarse features.
M_FAST_FIND M_ENABLE Force fast peak finding.
M_DISABLE Prevent fast peak finding.
M_DEFAULT Pre-processing decides if fast peak finding is appropriate.
Note: When fast peak finding is disabled, the initial search (at the resolution level determined by M_FIRST_LEVEL) computes the correlation at every position in the search area. This guarantees that the biggest match peak will be found, and that it will be investigated first. If fast peak finding is enabled, the search algorithm attempts to find the peaks without checking every point. This is safe in most cases, but can cause matches to be missed for models that produce very narrow peaks.
M_ALL M_DEFAULT Determine all search parameters automatically from the current speed and accuracy settings.
M_ALLOC_OFFSET_X any integer Set the model’s allocation X offset to the specified value. This might be useful when the original value is lost after rotating a model. You can use MpatInquire to inquire about the current X offset.
M_ALLOC_OFFSET_Y any integer Set the model’s allocation Y offset to the specified value. This might be useful when the original value is lost after rotating the model. You can use MpatInquire ?to inquire about the current Y offset.
M_MIN_SPACING_X 1.0 to 100.0 Set the minimum spacing (in X) between two models in order to be considered distinct.
M_DEFAULT Default is 75% of the model width (SizeX of MpatAllocAutoModel or MpatAllocModel).
M_MIN_SPACING_Y 1.0 to 100.0 Set the minimum spacing (in Y) between two models in order to be considered distinct.
M_DEFAULT Default is 75% of the model height (SizeY of MpatAllocAutoModel or MpatAllocModel).

These parameters are all saved and restored with the model, just like the other parameters such as search area, speed and accuracy.

See also

MpatSetSpeed, MpatSetAccuracy, MpatInquire

《MpatSetSearchParameter()函数》上有1条评论

评论已关闭。