MIL_ID SystemId, | //in |
MIL_INT64 ModelFinderType, | //in |
MIL_INT64 ControlFlag, | //in |
MIL_ID *ContextIdPtr | //out |
This function allocates a Model Finder context on the specified system. A Model Finder context contains all the information necessary to perform an MmodFind() search, including global search settings, and the individual model(s) to locate. When the Model Finder context is no longer required, you should release its memory, using MmodFree().
Define and add models to the Model Finder context using MmodDefine(). You must add at least one model to the context regardless of the context type. Some context types accept only one model.
The Model Finder context and individual model search settings can be adjusted using MmodControl().
Specifies the system on which to allocate the context. This parameter should be set to one of the following values:
For specifying the system identifier
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT_HOST |
Specifies the default Host system of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
MIL system identifier |
Specifies a valid system identifier, previously allocated using MsysAlloc(). |
Specifies the type of Model Finder context. This parameter must be set to one of the following values:
For the type of context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_GEOMETRIC |
Specifies that the Model Finder context uses a general geometric search algorithm. This algorithm uses geometric features to locate user-specified model(s). (summarize)Specifies that the Model Finder context uses a general geometric search algorithm. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GEOMETRIC_CONTROLLED |
Specifies that the Model Finder context uses a controlled geometric search algorithm. When there is a lot of geometric complexity, this search method is often faster and more robust than M_GEOMETRIC. The search method is especially fast when the angle between the occurrence and the nominal angle of the model (M_ANGLE) is small, although searching within an angular range is supported. This search method is recommended when there are only small differences in scale between the occurrence and the nominal scale of the model (M_SCALE); searching through a range of scales is not supported (M_SEARCH_SCALE_RANGE is disabled by default and cannot be set to M_ENABLE). You cannot get or draw the target edges for the entire target (M_GENERAL); you can only get or draw them in the region of an occurrence. (summarize)Specifies that the Model Finder context uses a controlled geometric search algorithm. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHAPE_CIRCLE |
Specifies that the Model Finder context uses a circular model search algorithm. This context only supports M_CIRCLE type models, and only supports one model per context. The model cannot be calibrated. If the target is associated with a camera calibration context, the model will be interpreted in world units; conversely, if the target does not have a camera calibration context associated with it, the model will be interpreted in pixel units. This search algorithm is recommended when the objects being sought are circular-type shapes, although the algorithm does have a tolerance for deformations of the circular shape. This controllable deformation tolerance (M_SAGITTA_TOLERANCE) could include detecting certain elliptical-type shapes as well as noisy circles. This search algorithm will typically find circular shapes faster and in a more robust manner than the search algorithms used for M_GEOMETRIC or M_GEOMETRIC_CONTROLLED types of Model Finder contexts. When using this type of Model Finder context, M_SEARCH_ANGLE_RANGE, M_SEARCH_POSITION_RANGE, and M_SEARCH_SCALE_RANGE are turned off by default and cannot be set to M_ENABLE. When using this type of context, you must also allocate an M_SHAPE_CIRCLE Model Finder result buffer. (summarize)Specifies that the Model Finder context uses a circular model search algorithm. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHAPE_ELLIPSE |
Specifies that the Model Finder context uses an elliptical model search algorithm. This context only supports M_ELLIPSE type models, and only supports one model per context. The model cannot be calibrated. If the target is associated with a camera calibration context, the model will be interpreted in world units; conversely, if the target does not have a camera calibration context associated with it, the model will be interpreted in pixel units. This search algorithm is recommended when the objects being sought are elliptical-type shapes (it can also find circles). Besides controllable deformation tolerance (M_SAGITTA_TOLERANCE), it allows finding ellipses at varying aspect ratios (M_MODEL_ASPECT_RATIO and M_MODEL_ASPECT_RATIO_..._FACTOR). When using this type of Model Finder context, M_SEARCH_ANGLE_RANGE, M_SEARCH_POSITION_RANGE, and M_SEARCH_SCALE_RANGE are turned off by default and cannot be set to M_ENABLE. When using this type of context, you must also allocate an M_SHAPE_ELLIPSE Model Finder result buffer. (summarize)Specifies that the Model Finder context uses an elliptical model search algorithm. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHAPE_RECTANGLE |
Specifies that the Model Finder context uses a rectangular model search algorithm. This context only supports M_RECTANGLE type models, and only supports one model per context. The model cannot be calibrated. If the target is associated with a camera calibration context, the model will be interpreted in world units; conversely, if the target does not have a camera calibration context associated with it, the model will be interpreted in pixel units. This search algorithm is recommended when the objects being sought are rectangular-type shapes (it can also find squares). Besides controllable deformation tolerance (M_DEVIATION_TOLERANCE), it allows finding rectangles at varying aspect ratios. However, at least a portion of each of their sides must be visible; that is, the model coverage on any side cannot be 0 (M_MIN_SIDE_COVERAGE). When using this type of context, you must also allocate an M_SHAPE_RECTANGLE Model Finder result buffer. (summarize)Specifies that the Model Finder context uses a rectangular model search algorithm. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHAPE_SEGMENT |
Specifies that the Model Finder context uses a segment model search algorithm. This context only supports M_SEGMENT type models, and only supports one model per context. The model cannot be calibrated. If the target is associated with a camera calibration context, the model will be interpreted in world units; conversely, if the target does not have a camera calibration context associated with it, the model will be interpreted in pixel units. This search algorithm is recommended when the objects being sought are segment-type shapes. Besides controllable deformation tolerance (M_DEVIATION_TOLERANCE), it allows finding segments lying on contours. When using this type of context, you must also allocate an M_SHAPE_SEGMENT Model Finder result buffer. (summarize)Specifies that the Model Finder context uses a segment model search algorithm. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milmod.lib. |
DLL | Requires mil.dll; milmod.dll. |