apply_texture_inspection_model—检查图像中的纹理
简短描述
apply_texture_inspection_model—检查图像中的纹理
签名
apply_texture_inspection_model(Image : NoveltyRegion : TextureInspectionModel : TextureInspectionResultID)
描述
操作符apply_texture_inspection_model将图像与训练好的纹理检测模型TextureInspectionModel进行比较。Image可以是单个灰度图像,也可以是灰度图像的元组。不符合纹理检查模型的像素将在NoveltyRegion中返回。此外,如果在set_texture_inspection_model_param中'gen_result_handle'被设置为'true',运算符还会返回结果句柄TextureInspectionResultID,其中包含关于纹理分类的更多详细信息。如果'gen_result_handle'被设置为'false', TextureInspectionResultID为空。
参数
Image (input_object) singlechannelimage-array→object (byte / uint2)
待检查纹理的图像。
NoveltyRegion (output_object) region-array→object
新奇区域。
texture_inspectionmodel (input_control)→(integer)
纹理检查模型的句柄。
texture_inspectionresultid (output_control, state is modified)→(integer)
处理的检查结果。
例程
* 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)
* Read and apply a test image
read_image (TestImage, 'carpet/carpet_02')
apply_texture_inspection_model (TestImage, DefectCandidates, \
TextureInspectionModel, \
TextureInspectionResultID)
* Clean up
clear_texture_inspection_model (TextureInspectionModel)
clear_texture_inspection_result (TextureInspectionResultID)
返回结果
本文链接:https://www.wtao8.com/post/242.html 转载需授权!