Operator Reference

read_texture_inspection_modelT_read_texture_inspection_modelReadTextureInspectionModelReadTextureInspectionModelread_texture_inspection_model (Operator)

read_texture_inspection_modelT_read_texture_inspection_modelReadTextureInspectionModelReadTextureInspectionModelread_texture_inspection_model — Read a texture inspection model from a file.

Signature

read_texture_inspection_model( : : FileName : TextureInspectionModel)

Herror T_read_texture_inspection_model(const Htuple FileName, Htuple* TextureInspectionModel)

void ReadTextureInspectionModel(const HTuple& FileName, HTuple* TextureInspectionModel)

void HTextureInspectionModel::ReadTextureInspectionModel(const HString& FileName)

void HTextureInspectionModel::ReadTextureInspectionModel(const char* FileName)

void HTextureInspectionModel::ReadTextureInspectionModel(const wchar_t* FileName)   ( Windows only)

static void HOperatorSet.ReadTextureInspectionModel(HTuple fileName, out HTuple textureInspectionModel)

void HTextureInspectionModel.ReadTextureInspectionModel(string fileName)

def read_texture_inspection_model(file_name: str) -> HHandle

Description

read_texture_inspection_modelread_texture_inspection_modelReadTextureInspectionModelReadTextureInspectionModelread_texture_inspection_model reads a texture inspection model that has been stored with write_texture_inspection_modelwrite_texture_inspection_modelWriteTextureInspectionModelWriteTextureInspectionModelwrite_texture_inspection_model. Since the training of a texture inspection model can consume a relatively long time, the texture inspection model is typically trained in an offline process and written to a file with write_texture_inspection_modelwrite_texture_inspection_modelWriteTextureInspectionModelWriteTextureInspectionModelwrite_texture_inspection_model. In the online process the texture inspection model is read with read_texture_inspection_modelread_texture_inspection_modelReadTextureInspectionModelReadTextureInspectionModelread_texture_inspection_model and subsequently used for evaluation with apply_texture_inspection_modelapply_texture_inspection_modelApplyTextureInspectionModelApplyTextureInspectionModelapply_texture_inspection_model. The default HALCON file extension for the texture inspection model is 'htim'.

After reading a trained texture inspection model, it is possible to classify test images using apply_texture_inspection_modelapply_texture_inspection_modelApplyTextureInspectionModelApplyTextureInspectionModelapply_texture_inspection_model. However, retraining this model can only be done, if the read model has images. Furthermore, modifying parameters of the model leads to an entire retraining.

For an explanation of the concept of the texture inspection see the introduction of chapter Inspection / Texture Inspection.

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 returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

FileNameFileNameFileNamefileNamefile_name (input_control)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name.

File extension: .htim

TextureInspectionModelTextureInspectionModelTextureInspectionModeltextureInspectionModeltexture_inspection_model (output_control)  texture_inspection_model HTextureInspectionModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the texture inspection model.

Example (HDevelop)

* Create texture inspection model
create_texture_inspection_model ('basic', TextureInspectionModel)

* Make this short example fast:
set_texture_inspection_model_param (TextureInspectionModel, \
                                    'gmm_em_max_iter', 1)
* Read and add training images
read_image (TrainImage, 'carpet/carpet_01')
add_texture_inspection_model_image (TrainImage, TextureInspectionModel, \
                                    Indices)
* Train the model
train_texture_inspection_model (TextureInspectionModel)
* Write out texture inspection model
write_texture_inspection_model (TextureInspectionModel, \
                                'ExampleModel.htim')
* Read in Model
read_texture_inspection_model ('ExampleModel.htim', \
                               TextureInspectionModelRead)
* Read and apply a test image
read_image (TestImage, 'carpet/carpet_02')
apply_texture_inspection_model (TestImage, DefectCandidates, \
                                TextureInspectionModelRead, \
                                TextureInspectionResultID)

Result

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

Possible Predecessors

write_texture_inspection_modelwrite_texture_inspection_modelWriteTextureInspectionModelWriteTextureInspectionModelwrite_texture_inspection_model

Possible Successors

apply_texture_inspection_modelapply_texture_inspection_modelApplyTextureInspectionModelApplyTextureInspectionModelapply_texture_inspection_model

See also

create_texture_inspection_modelcreate_texture_inspection_modelCreateTextureInspectionModelCreateTextureInspectionModelcreate_texture_inspection_model, clear_texture_inspection_modelclear_texture_inspection_modelClearTextureInspectionModelClearTextureInspectionModelclear_texture_inspection_model, set_texture_inspection_model_paramset_texture_inspection_model_paramSetTextureInspectionModelParamSetTextureInspectionModelParamset_texture_inspection_model_param, get_texture_inspection_model_paramget_texture_inspection_model_paramGetTextureInspectionModelParamGetTextureInspectionModelParamget_texture_inspection_model_param, add_texture_inspection_model_imageadd_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_image

Module

Matching