add_texture_inspection_model_image T_add_texture_inspection_model_image AddTextureInspectionModelImage AddTextureInspectionModelImage add_texture_inspection_model_image 添加纹理检查模型图像(算子)
名称
add_texture_inspection_model_image T_add_texture_inspection_model_image AddTextureInspectionModelImage AddTextureInspectionModelImage add_texture_inspection_model_image — 将训练图像添加到纹理检查模型中。
签名
描述
add_texture_inspection_model_image add_texture_inspection_model_image AddTextureInspectionModelImage AddTextureInspectionModelImage AddTextureInspectionModelImage add_texture_inspection_model_image 将训练图像添加到纹理检查模型 (TextureInspectionModel TextureInspectionModel TextureInspectionModel TextureInspectionModel textureInspectionModel texture_inspection_model )。后续所有计算均会考虑训练图像的域范围。由于特征提取会分析每个像素的特定邻域,域边界处的像素无法提取特征。边界尺寸 (Border ) 取决于 'patch_size' "patch_size" "patch_size" "patch_size" "patch_size" "patch_size" (通过 set_texture_inspection_model_param set_texture_inspection_model_param SetTextureInspectionModelParam SetTextureInspectionModelParam SetTextureInspectionModelParam set_texture_inspection_model_param 设置),计算结果为 Border
。
添加到纹理检查模型中的所有图像均用于训练过程(更多信息请参阅 train_texture_inspection_model train_texture_inspection_model TrainTextureInspectionModel TrainTextureInspectionModel TrainTextureInspectionModel train_texture_inspection_model )。此外,可通过
get_texture_inspection_model_image get_texture_inspection_model_image GetTextureInspectionModelImage GetTextureInspectionModelImage GetTextureInspectionModelImage get_texture_inspection_model_image 查询传递给纹理检查模型的所有图像。
每次添加的图像都会获得一个索引(Indices Indices Indices Indices indices indices ),这使得用户能够在添加的图像与其图像数据之间建立映射关系。通过调用 remove_texture_inspection_model_image remove_texture_inspection_model_image RemoveTextureInspectionModelImage RemoveTextureInspectionModelImage RemoveTextureInspectionModelImage remove_texture_inspection_model_image 方法,该索引可进一步用于从模型中删除不再需要的图像。
可以添加灰度图像或多通道图像。但所有传递的图像应具有相同的通道数。
有关纹理检查概念的说明,请参阅 检查 / 纹理检查 一章的引言。
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在内部数据级别上自动并行化。
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
参数
Image Image Image Image image image (输入对象) (multichannel-)image(-array) → object HImage HObject HImage Hobject (byte / uint2 / real)
完美的纹理图像
TextureInspectionModel TextureInspectionModel TextureInspectionModel TextureInspectionModel textureInspectionModel texture_inspection_model (输入控制,状态被修改) texture_inspection_model → HTextureInspectionModel , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
纹理检查模型的句柄。
Indices Indices Indices Indices indices indices (输出控制) integer(-array) → HTuple Sequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
已添加至纹理检查模型的图像索引。
示例(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)
* Read and apply a test image
read_image (TrainImage, 'carpet/carpet_02')
apply_texture_inspection_model (TestImage, DefectCandidates, \
TextureInspectionModel, \
TextureInspectionResultID)
结果
算子 add_texture_inspection_model_image add_texture_inspection_model_image AddTextureInspectionModelImage AddTextureInspectionModelImage AddTextureInspectionModelImage add_texture_inspection_model_image 在给定参数有效且在可接受范围内时返回值 2 ( H_MSG_TRUE )。
否则,将抛出异常。
可能的前趋
create_texture_inspection_model create_texture_inspection_model CreateTextureInspectionModel CreateTextureInspectionModel CreateTextureInspectionModel create_texture_inspection_model ,
set_texture_inspection_model_param set_texture_inspection_model_param SetTextureInspectionModelParam SetTextureInspectionModelParam SetTextureInspectionModelParam set_texture_inspection_model_param ,
get_texture_inspection_model_param get_texture_inspection_model_param GetTextureInspectionModelParam GetTextureInspectionModelParam GetTextureInspectionModelParam get_texture_inspection_model_param
可能的后继
train_texture_inspection_model train_texture_inspection_model TrainTextureInspectionModel TrainTextureInspectionModel TrainTextureInspectionModel train_texture_inspection_model ,
clear_texture_inspection_model clear_texture_inspection_model ClearTextureInspectionModel ClearTextureInspectionModel ClearTextureInspectionModel clear_texture_inspection_model ,
remove_texture_inspection_model_image remove_texture_inspection_model_image RemoveTextureInspectionModelImage RemoveTextureInspectionModelImage RemoveTextureInspectionModelImage remove_texture_inspection_model_image ,
get_texture_inspection_model_image get_texture_inspection_model_image GetTextureInspectionModelImage GetTextureInspectionModelImage GetTextureInspectionModelImage get_texture_inspection_model_image
模块
匹配