train_generic_shape_modelT_train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model (算子)

名称

train_generic_shape_modelT_train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model — 训练形状模型进行匹配。

签名

train_generic_shape_model(Template : : ModelID : )

Herror T_train_generic_shape_model(const Hobject Template, const Htuple ModelID)

void TrainGenericShapeModel(const HObject& Template, const HTuple& ModelID)

void HShapeModel::TrainGenericShapeModel(const HObject& Template) const

void HImage::TrainGenericShapeModel(const HShapeModel& ModelID) const

void HXLDCont::TrainGenericShapeModel(const HShapeModel& ModelID) const

static void HOperatorSet.TrainGenericShapeModel(HObject template, HTuple modelID)

void HShapeModel.TrainGenericShapeModel(HObject template)

void HImage.TrainGenericShapeModel(HShapeModel modelID)

void HXLDCont.TrainGenericShapeModel(HShapeModel modelID)

def train_generic_shape_model(template: HObject, model_id: HHandle) -> None

描述

算子 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

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

TemplateTemplateTemplateTemplatetemplatetemplate (输入对象)  (multichannel-)object(-array) objectHObjectHObjectHObjectHobject

Training image or xld.

ModelIDModelIDModelIDModelIDmodelIDmodel_id (输入控制,状态被修改)  shape_model HShapeModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

形状模型的句柄。

结果

如果参数有效,算子 train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

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

模块

匹配