classify_image_class_svmT_classify_image_class_svmClassifyImageClassSvmClassifyImageClassSvm (Operator)

Name

classify_image_class_svmT_classify_image_class_svmClassifyImageClassSvmClassifyImageClassSvm — Classify an image with a support vector machine.

Signature

classify_image_class_svm(Image : ClassRegions : SVMHandle : )

Herror T_classify_image_class_svm(const Hobject Image, Hobject* ClassRegions, const Htuple SVMHandle)

void ClassifyImageClassSvm(const HObject& Image, HObject* ClassRegions, const HTuple& SVMHandle)

HRegion HImage::ClassifyImageClassSvm(const HClassSvm& SVMHandle) const

HRegion HClassSvm::ClassifyImageClassSvm(const HImage& Image) const

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

HRegion HImage.ClassifyImageClassSvm(HClassSvm SVMHandle)

HRegion HClassSvm.ClassifyImageClassSvm(HImage image)

Description

classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvm performs a pixel classification with the support vector machine (SVM) SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle on the multichannel image ImageImageImageImageimage. Before calling classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvm the SVM must be trained with train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm. ImageImageImageImageimage must have NumFeatures channels, as specified with create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm. On output, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions contains NumClasses regions as the result of the classification. Note that the order of the regions that are returned in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions corresponds to the order of the classes as defined by the training regions in add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm.

To prevent that the SVM assigns pixels that lie outside the convex hull of the training data in the feature space to one of the classes, it is useful in many cases to explicitly train a rejection class by adding samples for the rejection class with add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm and by re-training the SVM with train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm.

An alternative for explicitly defining a rejection class is to use an SVM in the mode 'novelty-detection'"novelty-detection""novelty-detection""novelty-detection""novelty-detection". Please refer to the description in create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm and add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm.

Execution Information

Parameters

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

Input image.

ClassRegionsClassRegionsClassRegionsClassRegionsclassRegions (output_object)  region-array objectHRegionHRegionHobject *

Segmented classes.

SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle (input_control)  class_svm HClassSvm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

SVM handle.

Example (HDevelop)

read_image (Image, 'ic')
gen_rectangle1 (Board, 20, 270, 160, 420)
gen_rectangle1 (Capacitor, 359, 263, 371, 302)
gen_rectangle1 (Resistor, 200, 252, 290, 256)
gen_rectangle1 (IC, 180, 135, 216, 165)
concat_obj (Board, Capacitor, Classes)
concat_obj (Classes, Resistor, Classes)
concat_obj (Classes, IC, Classes)
create_class_svm (3, 'rbf', 0.01, 0.01, 4, 'one-versus-all', \
                  'normalization', 3, SVMHandle)
add_samples_image_class_svm (Image, Classes, SVMHandle)
train_class_svm (SVMHandle, 0.001, 'default')
reduce_class_svm (SVMHandle, 'bottom_up', 2, 0.01, SVMHandleReduced)
classify_image_class_svm (Image, ClassRegions, SVMHandleReduced)
dev_display (ClassRegions)

Result

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

Possible Predecessors

train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm, read_class_svmread_class_svmReadClassSvmReadClassSvmReadClassSvm, reduce_class_svmreduce_class_svmReduceClassSvmReduceClassSvmReduceClassSvm

Alternatives

classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmm, classify_image_class_knnclassify_image_class_knnClassifyImageClassKnnClassifyImageClassKnnClassifyImageClassKnn, classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlp, classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLut, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm, class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSup

See also

add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvm, create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm

Module

Foundation