Skip to content

classify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmmT_classify_image_class_gmm🔗

Short description🔗

classify_image_class_gmmClassifyImageClassGmmClassifyImageClassGmmclassify_image_class_gmmT_classify_image_class_gmm — Classify an image with a Gaussian Mixture Model.

Signature🔗

classify_image_class_gmm( image Image, out region ClassRegions, class_gmm GMMHandle, real RejectionThreshold )void ClassifyImageClassGmm( const HObject& Image, HObject* ClassRegions, const HTuple& GMMHandle, const HTuple& RejectionThreshold )static void HOperatorSet.ClassifyImageClassGmm( HObject image, out HObject classRegions, HTuple GMMHandle, HTuple rejectionThreshold )def classify_image_class_gmm( image: HObject, gmmhandle: HHandle, rejection_threshold: float ) -> HObject

Herror T_classify_image_class_gmm( 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

HRegion HImage.ClassifyImageClassGmm( HClassGmm GMMHandle, double rejectionThreshold )

HRegion HClassGmm.ClassifyImageClassGmm( HImage image, double rejectionThreshold )

Description🔗

classify_image_class_gmmClassifyImageClassGmm performs a pixel classification with the Gaussian Mixture Model (GMM) GMMHandleGMMHandlegmmhandle on the multichannel image Imageimageimage. Before calling classify_image_class_gmmClassifyImageClassGmm the GMM must be trained with train_class_gmmTrainClassGmm. Imageimageimage must have NumDimnumDimnum_dim channels, as specified with create_class_gmmCreateClassGmm. On output, ClassRegionsclassRegionsclass_regions contains NumClassesnumClassesnum_classes regions as the result of the classification. Note that the order of the regions that are returned in ClassRegionsclassRegionsclass_regions corresponds to the order of the classes as defined by the training regions in add_samples_image_class_gmmAddSamplesImageClassGmm. The parameter RejectionThresholdrejectionThresholdrejection_threshold can be used to reject pixels that have an uncertain classification. RejectionThresholdrejectionThresholdrejection_threshold represents a threshold on the K-sigma probability measure returned by the classification (see classify_class_gmmClassifyClassGmm and evaluate_class_gmmEvaluateClassGmm). All pixels having a probability below RejectionThresholdrejectionThresholdrejection_threshold are not assigned to any class.

Execution information🔗

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

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

  • Automatically parallelized on internal data level.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image → 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)

Input image.

ClassRegionsclassRegionsclass_regions (output_object) region-array → objectHObjectHRegionHObjectHobject *

Segmented classes.

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

GMM handle.

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

Threshold for the rejection of the classification.

Default: 0.50.5
Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.00.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_gmmClassifyImageClassGmm returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

train_class_gmmTrainClassGmm, read_class_gmmReadClassGmm

Alternatives

classify_image_class_knnClassifyImageClassKnn, classify_image_class_mlpClassifyImageClassMlp, classify_image_class_svmClassifyImageClassSvm, classify_image_class_lutClassifyImageClassLut, class_ndim_normClassNdimNorm, class_2dim_supClass2dimSup

See also

add_samples_image_class_gmmAddSamplesImageClassGmm, create_class_gmmCreateClassGmm

Module🔗

Foundation