add_samples_image_class_svmT_add_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvm (Operator)

Name

add_samples_image_class_svmT_add_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvm — Add training samples from an image to the training data of a support vector machine.

Signature

add_samples_image_class_svm(Image, ClassRegions : : SVMHandle : )

Herror T_add_samples_image_class_svm(const Hobject Image, const Hobject ClassRegions, const Htuple SVMHandle)

void AddSamplesImageClassSvm(const HObject& Image, const HObject& ClassRegions, const HTuple& SVMHandle)

void HImage::AddSamplesImageClassSvm(const HRegion& ClassRegions, const HClassSvm& SVMHandle) const

void HClassSvm::AddSamplesImageClassSvm(const HImage& Image, const HRegion& ClassRegions) const

static void HOperatorSet.AddSamplesImageClassSvm(HObject image, HObject classRegions, HTuple SVMHandle)

void HImage.AddSamplesImageClassSvm(HRegion classRegions, HClassSvm SVMHandle)

void HClassSvm.AddSamplesImageClassSvm(HImage image, HRegion classRegions)

Description

add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm adds training samples from the image ImageImageImageImageimage to the support vector machine (SVM) given by SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle. add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm is used to store the training samples before training a classifier for the pixel classification of multichannel images with classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvm. add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm works analogously to add_sample_class_svmadd_sample_class_svmAddSampleClassSvmAddSampleClassSvmAddSampleClassSvm.

The image ImageImageImageImageimage must have a number of channels equal to NumFeatures, as specified with create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm. The training regions for the NumClasses pixel classes are passed in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions. Hence, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions must be a tuple containing NumClasses 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 SVM by calling add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm 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 slower convergence of the training and a lower classification performance.

A further application of this operator is the automatic novelty detection, where, e.g., anomalies in color or texture can be detected. For this mode a training set that defines a sample region (e.g., skin regions for skin detection or samples of the correct texture) is passed to the SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle, which is created in the Mode 'novelty-detection'"novelty-detection""novelty-detection""novelty-detection""novelty-detection". After training, regions that differ from the trained sample regions are detected (e.g., the rejection class for skin or errors in texture).

Execution Information

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

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.

SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle (input_control, state is modified)  class_svm HClassSvm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

SVM handle.

Result

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

Possible Predecessors

create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm

Possible Successors

train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm, write_samples_class_svmwrite_samples_class_svmWriteSamplesClassSvmWriteSamplesClassSvmWriteSamplesClassSvm

Alternatives

read_samples_class_svmread_samples_class_svmReadSamplesClassSvmReadSamplesClassSvmReadSamplesClassSvm

See also

classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvm, add_sample_class_svmadd_sample_class_svmAddSampleClassSvmAddSampleClassSvmAddSampleClassSvm, clear_samples_class_svmclear_samples_class_svmClearSamplesClassSvmClearSamplesClassSvmClearSamplesClassSvm, get_sample_num_class_svmget_sample_num_class_svmGetSampleNumClassSvmGetSampleNumClassSvmGetSampleNumClassSvm, get_sample_class_svmget_sample_class_svmGetSampleClassSvmGetSampleClassSvmGetSampleClassSvm, add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlp

Module

Foundation