Skip to content

add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmadd_samples_image_class_gmmT_add_samples_image_class_gmm🔗

Short description🔗

add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmadd_samples_image_class_gmmT_add_samples_image_class_gmm — Add training samples from an image to the training data of a Gaussian Mixture Model.

Signature🔗

add_samples_image_class_gmm( image Image, region ClassRegions, class_gmm GMMHandle, real Randomize )add_samples_image_class_gmm( Image, ClassRegions : : GMMHandle, Randomize : )void AddSamplesImageClassGmm( const HObject& Image, const HObject& ClassRegions, const HTuple& GMMHandle, const HTuple& Randomize )static void HOperatorSet.AddSamplesImageClassGmm( HObject image, HObject classRegions, HTuple GMMHandle, HTuple randomize )def add_samples_image_class_gmm( image: HObject, class_regions: HObject, gmmhandle: HHandle, randomize: float ) -> None

Herror T_add_samples_image_class_gmm( const Hobject Image, const Hobject ClassRegions, const Htuple GMMHandle, const Htuple Randomize )

void HImage::AddSamplesImageClassGmm( const HRegion& ClassRegions, const HClassGmm& GMMHandle, double Randomize ) const

void HClassGmm::AddSamplesImageClassGmm( const HImage& Image, const HRegion& ClassRegions, double Randomize ) const

void HImage.AddSamplesImageClassGmm( HRegion classRegions, HClassGmm GMMHandle, double randomize )

void HClassGmm.AddSamplesImageClassGmm( HImage image, HRegion classRegions, double randomize )

Description🔗

add_samples_image_class_gmmAddSamplesImageClassGmm adds training samples from the Imageimageimage to the Gaussian Mixture Model (GMM) given by GMMHandleGMMHandlegmmhandle. add_samples_image_class_gmmAddSamplesImageClassGmm is used to store the training samples before a classifier to be used for the pixel classification of multichannel images with classify_image_class_gmmClassifyImageClassGmm is trained. add_samples_image_class_gmmAddSamplesImageClassGmm works analogously to add_sample_class_gmmAddSampleClassGmm. The Imageimageimage must have a number of channels equal to NumDimnumDimnum_dim, as specified with create_class_gmmCreateClassGmm. The training regions for the NumClassesnumClassesnum_classes pixel classes are passed in ClassRegionsclassRegionsclass_regions. Hence, ClassRegionsclassRegionsclass_regions must be a tuple containing NumClassesnumClassesnum_classes regions. The order of the regions in ClassRegionsclassRegionsclass_regions determines the class of the pixels. If there are no samples for a particular class in Imageimageimage an empty region must be passed at the position of the class in ClassRegionsclassRegionsclass_regions. With this mechanism it is possible to use multiple images to add training samples for all relevant classes to the GMM by calling add_samples_image_class_gmmAddSamplesImageClassGmm multiple times with the different images and suitably chosen regions. The regions in ClassRegionsclassRegionsclass_regions should contain representative training samples for the respective classes. Hence, they need not cover the entire image. The regions in ClassRegionsclassRegionsclass_regions should not overlap each other, because this would lead to the fact that in the training data the samples from the overlapping areas would be assigned to multiple classes, which may lead to a lower classification performance. Image data of integer type can be particularly badly suited for modeling with a GMM. Randomizerandomizerandomize can be used to overcome this problem, as explained in add_sample_class_gmmAddSampleClassGmm.

Execution information🔗

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

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

  • Processed without parallelization.

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 → object (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)object (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)HImage (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)Hobject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)

Training image.

ClassRegionsclassRegionsclass_regions (input_object) region-array → objectobjectHObjectHRegionHObjectHobject

Regions of the classes to be trained.

GMMHandleGMMHandlegmmhandle (input_control, state is modified) class_gmm → (handle)(handle)HTuple (HHandle)HClassGmm, HTuple (IntPtr)HHandleHtuple (handle)

GMM handle.

Randomizerandomizerandomize (input_control) real → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Standard deviation of the Gaussian noise added to the training data.

Default: 0.00.0
Suggested values: 0.0, 1.5, 2.00.0, 1.5, 2.0
Restriction: Randomize >= 0.0

Result🔗

If the parameters are valid, the operator add_samples_image_class_gmmAddSamplesImageClassGmm returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_class_gmmCreateClassGmm

Possible successors

train_class_gmmTrainClassGmm, write_samples_class_gmmWriteSamplesClassGmm

Alternatives

read_samples_class_gmmReadSamplesClassGmm

See also

classify_image_class_gmmClassifyImageClassGmm, add_sample_class_gmmAddSampleClassGmm, clear_samples_class_gmmClearSamplesClassGmm, get_sample_num_class_gmmGetSampleNumClassGmm, get_sample_class_gmmGetSampleClassGmm

Module🔗

Foundation