train_generic_shape_modelT_train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model (算子名称)
名称
train_generic_shape_modelT_train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model — Train a shape model for matching.
参数签名
Herror T_train_generic_shape_model(const Hobject Template, const Htuple ModelID)
描述
该算子 train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model trains the shape model
ModelIDModelIDModelIDModelIDmodelIDmodel_id in order to find the training pattern given in
TemplateTemplateTemplateTemplatetemplatetemplate.
TemplateTemplateTemplateTemplatetemplatetemplate accepts the training pattern to be of one of the following
types:
- Image:
-
The domain of the image given in TemplateTemplateTemplateTemplatetemplatetemplate sets the ROI of the
model.
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_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param.
- XLD contour:
-
XLD contours passed in TemplateTemplateTemplateTemplatetemplatetemplate should 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_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param.
Properties of the model ModelIDModelIDModelIDModelIDmodelIDmodel_id can be retrieved using
get_generic_shape_model_paramget_generic_shape_model_paramGetGenericShapeModelParamGetGenericShapeModelParamGetGenericShapeModelParamget_generic_shape_model_param and modified using
set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param.
Note that after modifying certain parameters the model needs to be
(re)trained, see set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
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.
参数表
TemplateTemplateTemplateTemplatetemplatetemplate (input_object) (multichannel-)object(-array) → objectHObjectHObjectHObjectHobject
Training image or xld.
ModelIDModelIDModelIDModelIDmodelIDmodel_id (input_control, state is modified) shape_model → HShapeModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the shape model.
结果
如果参数均有效,算子
train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model 返回值 2 (
H_MSG_TRUE)
.
If necessary an exception is raised.
可能的前置算子
create_generic_shape_modelcreate_generic_shape_modelCreateGenericShapeModelCreateGenericShapeModelCreateGenericShapeModelcreate_generic_shape_model,
set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param
可能的后置算子
find_generic_shape_modelfind_generic_shape_modelFindGenericShapeModelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model
模块
Matching