ClassesClassesClassesClasses | | | | Operators

create_class_lut_knnT_create_class_lut_knnCreateClassLutKnncreate_class_lut_knnCreateClassLutKnnCreateClassLutKnn (Operator)

Name

create_class_lut_knnT_create_class_lut_knnCreateClassLutKnncreate_class_lut_knnCreateClassLutKnnCreateClassLutKnn — Create a look-up table using a k-nearest neighbors classifier (k-NN) to classify byte images.

Signature

create_class_lut_knn( : : KNNHandle, GenParamName, GenParamValue : ClassLUTHandle)

Herror T_create_class_lut_knn(const Htuple KNNHandle, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ClassLUTHandle)

Herror create_class_lut_knn(const HTuple& KNNHandle, const HTuple& GenParamName, const HTuple& GenParamValue, Hlong* ClassLUTHandle)

HClassLUT HClassKnn::CreateClassLutKnn(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HClassLUT::CreateClassLutKnn(const HClassKnn& KNNHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void CreateClassLutKnn(const HTuple& KNNHandle, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ClassLUTHandle)

void HClassLUT::HClassLUT(const HClassKnn& KNNHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HClassLUT::CreateClassLutKnn(const HClassKnn& KNNHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

HClassLUT HClassKnn::CreateClassLutKnn(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HOperatorSetX.CreateClassLutKnn(
[in] VARIANT KNNHandle, [in] VARIANT GenParamName, [in] VARIANT GenParamValue, [out] VARIANT* ClassLUTHandle)

void HClassLUTX.CreateClassLutKnn(
[in] IHClassKnnX* KNNHandle, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

IHClassLUTX* HClassKnnX.CreateClassLutKnn(
[in] VARIANT GenParamName, [in] VARIANT GenParamValue)

static void HOperatorSet.CreateClassLutKnn(HTuple KNNHandle, HTuple genParamName, HTuple genParamValue, out HTuple classLUTHandle)

public HClassLUT(HClassKnn KNNHandle, HTuple genParamName, HTuple genParamValue)

void HClassLUT.CreateClassLutKnn(HClassKnn KNNHandle, HTuple genParamName, HTuple genParamValue)

HClassLUT HClassKnn.CreateClassLutKnn(HTuple genParamName, HTuple genParamValue)

Description

create_class_lut_knncreate_class_lut_knnCreateClassLutKnncreate_class_lut_knnCreateClassLutKnnCreateClassLutKnn generates a look-up table (LUT) ClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleclassLUTHandle using the data of a trained k-nearest neighbors classifier (k-NN) KNNHandleKNNHandleKNNHandleKNNHandleKNNHandleKNNHandle to classify multi-channel byte images. By using this k-NN-based LUT classifier, the operator classify_image_class_knnclassify_image_class_knnClassifyImageClassKnnclassify_image_class_knnClassifyImageClassKnnClassifyImageClassKnn of the subsequent classification can be replaced by the operator classify_image_class_lutclassify_image_class_lutClassifyImageClassLutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLut. The classification is speeded up considerably, because the estimation of the class in every image point is no longer necessary since every possible response of the k-NN is stored in the LUT. For the generation of the LUT, the parameter NumDim of called operator create_class_knncreate_class_knnCreateClassKnncreate_class_knnCreateClassKnnCreateClassKnn is important. The number of image channels the images must have to be classified is defined in NumDim.

To create the LUT, all pixel values are classified with classify_class_knnclassify_class_knnClassifyClassKnnclassify_class_knnClassifyClassKnnClassifyClassKnn. The returned classes are stored in the LUT. Because of the discretization of the LUT, the accuracy of the LUT classifier could become lower than the accuracy of classify_image_class_knnclassify_image_class_knnClassifyImageClassKnnclassify_image_class_knnClassifyImageClassKnnClassifyImageClassKnn.

With 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" the accuracy of the classification, the required storage, and the runtime needed to create the LUT can be controlled.

The following parameters of the k-NN-based LUT classifier can be set with GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName and GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue:

'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth":

Number of bits used from the pixels. It controls the storage requirement of the LUT classifier and is bounded by the bit depth of the image ('bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" <= 8). If the bit depth of the LUT is smaller ('bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" < 8), the classes of multiple pixel combinations will be mapped to the same LUT entry, which can result in a lower accuracy for the classification. One of these clusters contains pixel combinations, where NumDim denotes the dimension of the LUT, which is specified in create_class_knncreate_class_knnCreateClassKnncreate_class_knnCreateClassKnnCreateClassKnn. For example, for 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" = 7, NumDim = 3, the classes of 8 pixel combinations are mapped in the same LUT entry. The LUT requires at most bytes of storage. For example, for NumDim = 3, 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" = 8 and number of classes is smaller than 16, the LUT requires 8 MB of storage with internal storage optimization. The runtime for the classification in classify_image_class_lutclassify_image_class_lutClassifyImageClassLutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLut becomes minimal if the LUT fits into the cache. The default value is 8, typical values are [6,7,8]. Restrictions: 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" >= 1, 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" <= 8.

'rejection_threshold'"rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold":

Threshold for the rejection of uncertain classified points of the k-NN. The parameter represents a threshold on the distance returned by the classification (see classify_class_knnclassify_class_knnClassifyClassKnnclassify_class_knnClassifyClassKnnClassifyClassKnn). All pixels having a distance over 'rejection_threshold'"rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold" are not assigned to any class. The default value is 5. Restriction: 'rejection_threshold'"rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold" >= 0.

Parallelization

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

KNNHandleKNNHandleKNNHandleKNNHandleKNNHandleKNNHandle (input_control)  class_knn HClassKnn, HTupleHTupleHClassKnn, HTupleHClassKnnX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the k-NN classifier.

GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the generic parameters that can be adjusted for the LUT classifier creation.

Default value: []

Suggested values: 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth", 'rejection_threshold'"rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold""rejection_threshold"

GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value-array HTupleHTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Values of the generic parameters that can be adjusted for the LUT classifier creation.

Default value: []

Suggested values: 8, 7, 6, 0.5, 5, 10, 50

ClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleclassLUTHandle (output_control)  class_lut HClassLUT, HTupleHTupleHClassLUT, HTupleHClassLUTX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the LUT classifier.

Result

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

Possible Predecessors

train_class_knntrain_class_knnTrainClassKnntrain_class_knnTrainClassKnnTrainClassKnn, read_class_knnread_class_knnReadClassKnnread_class_knnReadClassKnnReadClassKnn

Possible Successors

classify_image_class_lutclassify_image_class_lutClassifyImageClassLutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLut

Alternatives

create_class_lut_svmcreate_class_lut_svmCreateClassLutSvmcreate_class_lut_svmCreateClassLutSvmCreateClassLutSvm, create_class_lut_gmmcreate_class_lut_gmmCreateClassLutGmmcreate_class_lut_gmmCreateClassLutGmmCreateClassLutGmm, create_class_lut_mlpcreate_class_lut_mlpCreateClassLutMlpcreate_class_lut_mlpCreateClassLutMlpCreateClassLutMlp

See also

classify_image_class_lutclassify_image_class_lutClassifyImageClassLutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLut, clear_class_lutclear_class_lutClearClassLutclear_class_lutClearClassLutClearClassLut

Module

Foundation


ClassesClassesClassesClasses | | | | Operators