add_texture_inspection_model_imageT_add_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_image添加纹理检查模型图像(算子)

名称

add_texture_inspection_model_imageT_add_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_image — 将训练图像添加到纹理检查模型中。

签名

add_texture_inspection_model_image(Image : : TextureInspectionModel : Indices)

Herror T_add_texture_inspection_model_image(const Hobject Image, const Htuple TextureInspectionModel, Htuple* Indices)

void AddTextureInspectionModelImage(const HObject& Image, const HTuple& TextureInspectionModel, HTuple* Indices)

HTuple HImage::AddTextureInspectionModelImage(const HTextureInspectionModel& TextureInspectionModel) const

HTuple HTextureInspectionModel::AddTextureInspectionModelImage(const HImage& Image) const

static HTuple HTextureInspectionResult::AddTextureInspectionModelImage(const HImage& Image, const HTextureInspectionModel& TextureInspectionModel)

static void HOperatorSet.AddTextureInspectionModelImage(HObject image, HTuple textureInspectionModel, out HTuple indices)

HTuple HImage.AddTextureInspectionModelImage(HTextureInspectionModel textureInspectionModel)

HTuple HTextureInspectionModel.AddTextureInspectionModelImage(HImage image)

static HTuple HTextureInspectionResult.AddTextureInspectionModelImage(HImage image, HTextureInspectionModel textureInspectionModel)

def add_texture_inspection_model_image(image: HObject, texture_inspection_model: HHandle) -> Sequence[int]

def add_texture_inspection_model_image_s(image: HObject, texture_inspection_model: HHandle) -> int

描述

add_texture_inspection_model_imageadd_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_image 将训练图像添加到纹理检查模型 (TextureInspectionModelTextureInspectionModelTextureInspectionModelTextureInspectionModeltextureInspectionModeltexture_inspection_model)。后续所有计算均会考虑训练图像的域范围。由于特征提取会分析每个像素的特定邻域,域边界处的像素无法提取特征。边界尺寸 (Border) 取决于 'patch_size'"patch_size""patch_size""patch_size""patch_size""patch_size" (通过 set_texture_inspection_model_paramset_texture_inspection_model_paramSetTextureInspectionModelParamSetTextureInspectionModelParamSetTextureInspectionModelParamset_texture_inspection_model_param 设置),计算结果为 Border

添加到纹理检查模型中的所有图像均用于训练过程(更多信息请参阅 train_texture_inspection_modeltrain_texture_inspection_modelTrainTextureInspectionModelTrainTextureInspectionModelTrainTextureInspectionModeltrain_texture_inspection_model )。此外,可通过 get_texture_inspection_model_imageget_texture_inspection_model_imageGetTextureInspectionModelImageGetTextureInspectionModelImageGetTextureInspectionModelImageget_texture_inspection_model_image 查询传递给纹理检查模型的所有图像。

每次添加的图像都会获得一个索引(IndicesIndicesIndicesIndicesindicesindices),这使得用户能够在添加的图像与其图像数据之间建立映射关系。通过调用 remove_texture_inspection_model_imageremove_texture_inspection_model_imageRemoveTextureInspectionModelImageRemoveTextureInspectionModelImageRemoveTextureInspectionModelImageremove_texture_inspection_model_image 方法,该索引可进一步用于从模型中删除不再需要的图像。

可以添加灰度图像或多通道图像。但所有传递的图像应具有相同的通道数。

有关纹理检查概念的说明,请参阅 检查 / 纹理检查 一章的引言。

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2 / real)

完美的纹理图像

TextureInspectionModelTextureInspectionModelTextureInspectionModelTextureInspectionModeltextureInspectionModeltexture_inspection_model (输入控制,状态被修改)  texture_inspection_model HTextureInspectionModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

纹理检查模型的句柄。

IndicesIndicesIndicesIndicesindicesindices (输出控制)  integer(-array) HTupleSequence[int]HTupleHtuple (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_imageadd_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_image 在给定参数有效且在可接受范围内时返回值 2 ( H_MSG_TRUE )。 否则,将抛出异常。

可能的前趋

create_texture_inspection_modelcreate_texture_inspection_modelCreateTextureInspectionModelCreateTextureInspectionModelCreateTextureInspectionModelcreate_texture_inspection_model, set_texture_inspection_model_paramset_texture_inspection_model_paramSetTextureInspectionModelParamSetTextureInspectionModelParamSetTextureInspectionModelParamset_texture_inspection_model_param, get_texture_inspection_model_paramget_texture_inspection_model_paramGetTextureInspectionModelParamGetTextureInspectionModelParamGetTextureInspectionModelParamget_texture_inspection_model_param

可能的后继

train_texture_inspection_modeltrain_texture_inspection_modelTrainTextureInspectionModelTrainTextureInspectionModelTrainTextureInspectionModeltrain_texture_inspection_model, clear_texture_inspection_modelclear_texture_inspection_modelClearTextureInspectionModelClearTextureInspectionModelClearTextureInspectionModelclear_texture_inspection_model, remove_texture_inspection_model_imageremove_texture_inspection_model_imageRemoveTextureInspectionModelImageRemoveTextureInspectionModelImageRemoveTextureInspectionModelImageremove_texture_inspection_model_image, get_texture_inspection_model_imageget_texture_inspection_model_imageGetTextureInspectionModelImageGetTextureInspectionModelImageGetTextureInspectionModelImageget_texture_inspection_model_image

模块

匹配