Skip to content

train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_modelT_train_generic_shape_model🔗

Short description🔗

train_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_modelT_train_generic_shape_model — Train a shape model for matching.

Signature🔗

train_generic_shape_model( object Template, shape_model ModelID )void TrainGenericShapeModel( const HObject& Template, const HTuple& ModelID )static void HOperatorSet.TrainGenericShapeModel( HObject template, HTuple modelID )def train_generic_shape_model( template: HObject, model_id: HHandle ) -> None

Herror T_train_generic_shape_model( 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

void HShapeModel.TrainGenericShapeModel( HObject template )

void HImage.TrainGenericShapeModel( HShapeModel modelID )

void HXLDCont.TrainGenericShapeModel( HShapeModel modelID )

Description🔗

The operator train_generic_shape_modelTrainGenericShapeModel trains the shape model ModelIDmodelIDmodel_id in order to find the training pattern given in Templatetemplatetemplate.

Templatetemplatetemplate accepts the training pattern to be of one of the following types:

Properties of the model ModelIDmodelIDmodel_id can be retrieved using get_generic_shape_model_paramGetGenericShapeModelParam and modified using set_generic_shape_model_paramSetGenericShapeModelParam. Note that after modifying certain parameters the model needs to be (re)trained, see set_generic_shape_model_paramSetGenericShapeModelParam.

Added training samples: In case training samples have been added they are freed from the model after a successful call of train_generic_shape_modelTrainGenericShapeModel.

Execution information🔗

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 supports canceling timeouts and interrupts.

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🔗

Templatetemplatetemplate (input_object) (multichannel-)object(-array) → objectHObjectHObjectHObjectHobject

Training image or xld.

ModelIDmodelIDmodel_id (input_control, state is modified) shape_model → (handle)HTuple (HHandle)HShapeModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the shape model.

Result🔗

If the parameters are valid, the operator train_generic_shape_modelTrainGenericShapeModel returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_generic_shape_modelCreateGenericShapeModel, set_generic_shape_model_paramSetGenericShapeModelParam

Possible successors

find_generic_shape_modelFindGenericShapeModel

Module🔗

Matching