Skip to content

add_texture_inspection_model_imageadd_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_imageT_add_texture_inspection_model_image🔗

Short description🔗

add_texture_inspection_model_imageadd_texture_inspection_model_imageAddTextureInspectionModelImageAddTextureInspectionModelImageadd_texture_inspection_model_imageT_add_texture_inspection_model_image — Add training images to the texture inspection model.

Signature🔗

add_texture_inspection_model_image( image Image, texture_inspection_model TextureInspectionModel, out integer Indices )add_texture_inspection_model_image( Image : : TextureInspectionModel : Indices )void AddTextureInspectionModelImage( const HObject& Image, const HTuple& TextureInspectionModel, HTuple* Indices )static void HOperatorSet.AddTextureInspectionModelImage( HObject image, HTuple textureInspectionModel, out HTuple indices )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 ) -> intHerror T_add_texture_inspection_model_image( 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 )

HTuple HImage.AddTextureInspectionModelImage( HTextureInspectionModel textureInspectionModel )

HTuple HTextureInspectionModel.AddTextureInspectionModelImage( HImage image )

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

Description🔗

add_texture_inspection_model_imageAddTextureInspectionModelImage adds training images to the texture inspection model (TextureInspectionModeltextureInspectionModeltexture_inspection_model). The domain of the training images is considered in all further calculations. Since the feature extraction considers a certain neighborhood of each pixel, no features can be extracted for pixels at the border of the domain. The border size (Border) depends on the 'patch_size'"patch_size" (set_texture_inspection_model_paramSetTextureInspectionModelParam) and computes to Border\(=('\textit{patch\_size}'-1)/2\).

All images which are added to the texture inspection model are used within the training process (see train_texture_inspection_modelTrainTextureInspectionModel for more information). Furthermore, it is possible to query all of the images passed to the texture inspection model with get_texture_inspection_model_imageGetTextureInspectionModelImage.

Every added image receives an index (Indicesindicesindices), which allows the user to generate an assignment between the added images and his image data. By calls of remove_texture_inspection_model_imageRemoveTextureInspectionModelImage, the index can further be used to delete images from the model that are not needed anymore.

It is possible to add either gray-scale images or multichannel images. However, all of the passed images should have the same number of channels.

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / uint2 / real)object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Image of flawless texture.

TextureInspectionModeltextureInspectionModeltexture_inspection_model (input_control, state is modified) texture_inspection_model → (handle)(handle)HTuple (HHandle)HTextureInspectionModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the texture inspection model.

Indicesindicesindices (output_control) integer(-array) → (integer)(integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Indices of the images that have been added to 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)
* Read and apply a test image
read_image (TrainImage, 'carpet/carpet_02')
apply_texture_inspection_model (TestImage, DefectCandidates, \
                                TextureInspectionModel, \
                                TextureInspectionResultID)

Result🔗

The operator add_texture_inspection_model_imageAddTextureInspectionModelImage returns the value 2 (H_MSG_TRUE) if the given parameters are valid and within acceptable range. Otherwise, an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_texture_inspection_modelCreateTextureInspectionModel, set_texture_inspection_model_paramSetTextureInspectionModelParam, get_texture_inspection_model_paramGetTextureInspectionModelParam

Possible successors

train_texture_inspection_modelTrainTextureInspectionModel, clear_texture_inspection_modelClearTextureInspectionModel, remove_texture_inspection_model_imageRemoveTextureInspectionModelImage, get_texture_inspection_model_imageGetTextureInspectionModelImage

Module🔗

Matching