serialize_texture_inspection_model — Serialize a texture inspection model.
serialize_texture_inspection_model( : : TextureInspectionModel : SerializedItemHandle)
serialize_texture_inspection_model serializes a texture inspection
model (see fwrite_serialized_item
for an introduction of the basic principle of serialization).
The texture inspection model is defined by the handle
TextureInspectionModel. The serialized texture inspection model is
returned by the handle SerializedItemHandle and can be deserialized
by deserialize_texture_inspection_model.
For an explanation of the concept of the texture inspection see the introduction of chapter Inspection / Texture Inspection.
TextureInspectionModel (input_control) texture_inspection_model → (handle)
Handle of the texture inspection model.
SerializedItemHandle (output_control) serialized_item → (handle)
序列化项的句柄。
* Create texture inspection model
create_texture_inspection_model ('basic', TextureInspectionModel)
* Set parameters
set_texture_inspection_model_param (TextureInspectionModel, \
'gen_result_handle', 'true')
* 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)
* Serialize texture inspection model
serialize_texture_inspection_model (TextureInspectionModel, \
SerializedItemHandle)
* Deserialize in Model
deserialize_texture_inspection_model (SerializedItemHandle, \
TextureInspectionModelSerialized)
* Read and apply a test image
read_image (TestImage, 'carpet/carpet_02')
apply_texture_inspection_model (TestImage, DefectCandidates, \
TextureInspectionModelSerialized, \
TextureInspectionResultID)
如果参数均有效,算子
serialize_texture_inspection_model 返回值 2 (
H_MSG_TRUE)
. If
necessary, an exception is raised.
train_texture_inspection_model
clear_texture_inspection_model,
fwrite_serialized_item,
send_serialized_item,
deserialize_texture_inspection_model
create_texture_inspection_model,
read_texture_inspection_model,
deserialize_texture_inspection_model
Matching