SearchModel
Registers search model
int SearchModel(
const IMAGE *image,
const FIG_HEADER *figure,
const int searchMode,
const int startAngle,
const int endAngle,
const int searchSpeed,
const int searchStepRough,
const int modelStepRateRough,
const int modelStepDetail,
const int stepAngleRough,
const int stepAngleDetail,
BYTE *model
)
Parameters
*image
|
Image data structure address
|
*figure
|
Figure data structure address
|
searchMode
|
Search mode
0: Rotation off (CR)
1, 2: Rotation on (CR)
3: Rotation on (Precise)
|
startAngle
|
Rotation start angle (-180 to 180: default is 0)
|
endAngle
|
Rotation end angle (-180 to 180: default is 0)
|
searchSpeed
|
Search speed (-1, 1 to 10: default is 3)
|
searchStepRough
|
Rough search, Search skipping (1 to 20: default is 4)
|
modelStepRateRough
|
Rough search, Model skipping scale (1 to 10: default is 2)
Rough search model skipping = (searchStepRough * modelStepRateRough)
|
modelStepDetail
|
Detail search, Model skipping (1 to 200: default is 8)
|
stepAngleRough
|
Rough search Skipping angle (1 to 90: default is 5)
|
stepAngleDetail
|
Detail search Skipping angle (1 to 90: default is 1)
|
*model
|
Model data
|
Return Value
NORMAL(0): Successful completion
ERROR(-1): Unsuccessful completion
Description
To register a model, allocate memory space for the model from the size obtained by the "get search model information" operation, and then call the model registration processing to write the model data to this space.
"Search skipping number" and "model skipping scale" are enabled only when -1 is specified as the search speed. These values are used as the parameters for rough search.
The model skipping number in a detail search is equal to the search skipping number in rough search, and the search skipping value is fixed at 1.
If the search speed is 1 or bigger, each skipping number is calculated as follows:
Rough search
|
Model skipping = (Search speed + 1) x 2
|
Search skipping = (Search speed + 1)
|
Detail search
|
Model skipping = (Search speed + 1)
|
Search skipping = 1
|
The values of the rotation start/end angles are for a rough search. The rotation angle range of a detail search is from "-stepAngleRough to stepAngleRough".
Therefore, by increasing only the rough search skipping angle it may slow down the processing speed because the detail search angle range is also increased.
Notes