classify_image_class_gmmT_classify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmm (Operator)

Name

classify_image_class_gmmT_classify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmm — Classify an image with a Gaussian Mixture Model.

Signature

classify_image_class_gmm(Image : ClassRegions : GMMHandle, RejectionThreshold : )

Herror T_classify_image_class_gmm(const Hobject Image, Hobject* ClassRegions, const Htuple GMMHandle, const Htuple RejectionThreshold)

void ClassifyImageClassGmm(const HObject& Image, HObject* ClassRegions, const HTuple& GMMHandle, const HTuple& RejectionThreshold)

HRegion HImage::ClassifyImageClassGmm(const HClassGmm& GMMHandle, double RejectionThreshold) const

HRegion HClassGmm::ClassifyImageClassGmm(const HImage& Image, double RejectionThreshold) const

static void HOperatorSet.ClassifyImageClassGmm(HObject image, out HObject classRegions, HTuple GMMHandle, HTuple rejectionThreshold)

HRegion HImage.ClassifyImageClassGmm(HClassGmm GMMHandle, double rejectionThreshold)

HRegion HClassGmm.ClassifyImageClassGmm(HImage image, double rejectionThreshold)

def classify_image_class_gmm(image: HObject, gmmhandle: HHandle, rejection_threshold: float) -> HObject

Description

classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmm performs a pixel classification with the Gaussian Mixture Model (GMM) GMMHandleGMMHandleGMMHandleGMMHandleGMMHandlegmmhandle on the multichannel image ImageImageImageImageimageimage. Before calling classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmm the GMM must be trained with train_class_gmmtrain_class_gmmTrainClassGmmTrainClassGmmTrainClassGmmtrain_class_gmm. ImageImageImageImageimageimage must have NumDimNumDimNumDimNumDimnumDimnum_dim channels, as specified with create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmmcreate_class_gmm. On output, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions contains NumClassesNumClassesNumClassesNumClassesnumClassesnum_classes regions as the result of the classification. Note that the order of the regions that are returned in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions corresponds to the order of the classes as defined by the training regions in add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmmadd_samples_image_class_gmm. The parameter RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThresholdrejection_threshold can be used to reject pixels that have an uncertain classification. RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThresholdrejection_threshold represents a threshold on the K-sigma probability measure returned by the classification (see classify_class_gmmclassify_class_gmmClassifyClassGmmClassifyClassGmmClassifyClassGmmclassify_class_gmm and evaluate_class_gmmevaluate_class_gmmEvaluateClassGmmEvaluateClassGmmEvaluateClassGmmevaluate_class_gmm). All pixels having a probability below RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThresholdrejection_threshold are not assigned to any class.

Execution Information

Parameters

ImageImageImageImageimageimage (input_object)  (multichannel-)image objectHImageHObjectHImageHobject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)

Input image.

ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions (output_object)  region-array objectHRegionHObjectHRegionHobject *

Segmented classes.

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandlegmmhandle (input_control)  class_gmm HClassGmm, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

GMM handle.

RejectionThresholdRejectionThresholdRejectionThresholdRejectionThresholdrejectionThresholdrejection_threshold (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Threshold for the rejection of the classification.

Default value: 0.5

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Restriction: RejectionThreshold >= 0.0 && RejectionThreshold <= 1.0

Example (HDevelop)

read_image (Image, 'ic')
gen_rectangle1 (Board, 80, 320, 110, 350)
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_gmm (3, 4, [1,30], 'full', 'none',0, 42, GMMHandle)
add_samples_image_class_gmm (Image, Classes, GMMHandle, 1.5)
get_sample_num_class_gmm (GMMHandle, NumSamples)
train_class_gmm (GMMHandle, 150, 1e-4, 'training', 1e-4, Centers, Iter)
classify_image_class_gmm (Image, ClassRegions, GMMHandle, 0.0001)

Result

If the parameters are valid, the operator classify_image_class_gmmclassify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmm returns the value TRUE. If necessary an exception is raised.

Possible Predecessors

train_class_gmmtrain_class_gmmTrainClassGmmTrainClassGmmTrainClassGmmtrain_class_gmm, read_class_gmmread_class_gmmReadClassGmmReadClassGmmReadClassGmmread_class_gmm

Alternatives

classify_image_class_knnclassify_image_class_knnClassifyImageClassKnnClassifyImageClassKnnClassifyImageClassKnnclassify_image_class_knn, classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlpclassify_image_class_mlp, classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvmclassify_image_class_svm, classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLutclassify_image_class_lut, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm, class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSupclass_2dim_sup

See also

add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmmadd_samples_image_class_gmm, create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmmcreate_class_gmm

Module

Foundation