Operator Reference
train_generic_shape_model (Operator)
train_generic_shape_model — Train a shape model for matching.
Signature
Description
The operator train_generic_shape_model trains the shape model
ModelID in order to find the training pattern given in
Template.
Template accepts the training pattern to be of one of the following
types:
- Image:
-
The domain of the image given in
Templatesets the ROI of the model. Which channels of a multichannel image are used depends on the model parameter 'metric' (seeset_generic_shape_model_param).The model origin (reference point) is defined by the center of gravity of the image domain. The origin can be reset to a different point using
set_generic_shape_model_param. - XLD contour:
-
XLD contours passed in
Templateshould represent the gray value edges of the pattern to be searched.The model origin (reference point) is defined by the center of gravity of the smallest axis-parallel rectangle enclosing the contours. The origin can be reset to a different point using
set_generic_shape_model_param.
Properties of the model ModelID can be retrieved using
get_generic_shape_model_param and modified using
set_generic_shape_model_param.
Note that after modifying certain parameters the model needs to be
(re)trained, see set_generic_shape_model_param.
Added training samples:
In case training samples have been added they are freed from the model after
a successful call of train_generic_shape_model.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator modifies the state of the following input parameter:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
Parameters
Template (input_object) (multichannel-)object(-array) → object
Training image or xld.
ModelID (input_control, state is modified) shape_model → (handle)
Handle of the shape model.
Result
If the parameters are valid, the operator
train_generic_shape_model returns the value 2 (
H_MSG_TRUE)
.
If necessary an exception is raised.
Possible Predecessors
create_generic_shape_model,
set_generic_shape_model_param
Possible Successors
Module
Matching