add_samples_image_class_gmmT_add_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmm (Operator)

Name

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

Signature

add_samples_image_class_gmm(Image, ClassRegions : : GMMHandle, Randomize : )

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

void AddSamplesImageClassGmm(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

static void HOperatorSet.AddSamplesImageClassGmm(HObject image, HObject classRegions, HTuple GMMHandle, HTuple randomize)

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

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

Description

add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm adds training samples from the ImageImageImageImageimage to the Gaussian Mixture Model (GMM) given by GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle. add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm is used to store the training samples before a classifier to be used for the pixel classification of multichannel images with classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmm is trained. add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm works analogously to add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm. The ImageImageImageImageimage must have a number of channels equal to NumDimNumDimNumDimNumDimnumDim, as specified with create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm. The training regions for the NumClassesNumClassesNumClassesNumClassesnumClasses pixel classes are passed in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions. Hence, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions must be a tuple containing NumClassesNumClassesNumClassesNumClassesnumClasses regions. The order of the regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions determines the class of the pixels. If there are no samples for a particular class in ImageImageImageImageimage an empty region must be passed at the position of the class in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions. 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_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm multiple times with the different images and suitably chosen regions. The regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions should contain representative training samples for the respective classes. Hence, they need not cover the entire image. The regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions 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. RandomizeRandomizeRandomizeRandomizerandomize can be used to overcome this problem, as explained in add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm.

Execution Information

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image objectHImageHImageHobject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)

Training image.

ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions (input_object)  region-array objectHRegionHRegionHobject

Regions of the classes to be trained.

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle (input_control, state is modified)  class_gmm HClassGmm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

GMM handle.

RandomizeRandomizeRandomizeRandomizerandomize (input_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

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

Default value: 0.0

Suggested values: 0.0, 1.5, 2.0

Restriction: Randomize >= 0.0

Result

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

Possible Predecessors

create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm

Possible Successors

train_class_gmmtrain_class_gmmTrainClassGmmTrainClassGmmTrainClassGmm, write_samples_class_gmmwrite_samples_class_gmmWriteSamplesClassGmmWriteSamplesClassGmmWriteSamplesClassGmm

Alternatives

read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmm

See also

classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmm, add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm, clear_samples_class_gmmclear_samples_class_gmmClearSamplesClassGmmClearSamplesClassGmmClearSamplesClassGmm, get_sample_num_class_gmmget_sample_num_class_gmmGetSampleNumClassGmmGetSampleNumClassGmmGetSampleNumClassGmm, get_sample_class_gmmget_sample_class_gmmGetSampleClassGmmGetSampleClassGmmGetSampleClassGmm

Module

Foundation