create_class_lut_svmT_create_class_lut_svmCreateClassLutSvmCreateClassLutSvmcreate_class_lut_svm (算子)

名称

create_class_lut_svmT_create_class_lut_svmCreateClassLutSvmCreateClassLutSvmcreate_class_lut_svm — 使用支持向量机创建查找表来对字节图像进行分类。

签名

create_class_lut_svm( : : SVMHandle, GenParamName, GenParamValue : ClassLUTHandle)

Herror T_create_class_lut_svm(const Htuple SVMHandle, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ClassLUTHandle)

void CreateClassLutSvm(const HTuple& SVMHandle, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ClassLUTHandle)

HClassLUT HClassSvm::CreateClassLutSvm(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HClassLUT::HClassLUT(const HClassSvm& SVMHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HClassLUT::CreateClassLutSvm(const HClassSvm& SVMHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

static void HOperatorSet.CreateClassLutSvm(HTuple SVMHandle, HTuple genParamName, HTuple genParamValue, out HTuple classLUTHandle)

HClassLUT HClassSvm.CreateClassLutSvm(HTuple genParamName, HTuple genParamValue)

public HClassLUT(HClassSvm SVMHandle, HTuple genParamName, HTuple genParamValue)

void HClassLUT.CreateClassLutSvm(HClassSvm SVMHandle, HTuple genParamName, HTuple genParamValue)

def create_class_lut_svm(svmhandle: HHandle, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, int]]) -> HHandle

描述

create_class_lut_svmcreate_class_lut_svmCreateClassLutSvmCreateClassLutSvmCreateClassLutSvmcreate_class_lut_svm generates a look-up table (LUT) ClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleclassLUTHandleclass_luthandle using the data of a trained Support-Vector-Machine (SVM) SVMHandleSVMHandleSVMHandleSVMHandleSVMHandlesvmhandle to classify multi-channel byte images. By using this SVM-based LUT classifier the operator classify_image_class_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvmclassify_image_class_svm of the subsequent classification can be replaced by the operator classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLutclassify_image_class_lut。The classification gets a major speed-up, because the estimation of the class in every image point is no longer necessary since every possible response of the SVM is stored in the LUT. For the generation of the LUT, the parameters NumFeaturesNumFeaturesNumFeaturesNumFeaturesnumFeaturesnum_features, PreprocessingPreprocessingPreprocessingPreprocessingpreprocessingpreprocessing, and NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components defined in the earlier called operator create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvmcreate_class_svm are important. In NumFeaturesNumFeaturesNumFeaturesNumFeaturesnumFeaturesnum_features, the number of image channels the images must have to be classified is defined. By using the PreprocessingPreprocessingPreprocessingPreprocessingpreprocessingpreprocessing (see create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvmcreate_class_svm) the number of image channels can be transformed to NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components. NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components defines the length of the feature vector, which the classifier classify_class_svmclassify_class_svmClassifyClassSvmClassifyClassSvmClassifyClassSvmclassify_class_svm handles internally. Because of performance and disk space, the LUT is restricted to be maximal 3-dimensional. Since it replaces the operator classify_class_svmclassify_class_svmClassifyClassSvmClassifyClassSvmClassifyClassSvmclassify_class_svm, NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components <= 3 must hold. If there is no preprocessing that reduces the number of image channels (NumFeaturesNumFeaturesNumFeaturesNumFeaturesnumFeaturesnum_features = NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components), all possible pixel values, which can occur in a byte image, are classified with classify_class_svmclassify_class_svmClassifyClassSvmClassifyClassSvmClassifyClassSvmclassify_class_svm。The returned classes are stored in the LUT. If there is a preprocessing that reduces the number of image channels (NumFeaturesNumFeaturesNumFeaturesNumFeaturesnumFeaturesnum_features > NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components), the preprocessing parameters of the SVM are stored in a separate structure of the LUT. To create the LUT, all transformed pixel values are classified with classify_class_svmclassify_class_svmClassifyClassSvmClassifyClassSvmClassifyClassSvmclassify_class_svm。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_svmclassify_image_class_svmClassifyImageClassSvmClassifyImageClassSvmClassifyImageClassSvmclassify_image_class_svm。With 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" and 'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection" the accuracy of the classification, the required storage, and the runtime needed to create the LUT can be controlled.

The following parameters of the SVM-based LUT classifier can be set with GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:

'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 NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components denotes the dimension of the LUT, which is specified in create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvmcreate_class_svm。For example, for 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" = 7, NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components = 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 NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components = 3, 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" = 8 and NumClassesNumClassesNumClassesNumClassesnumClassesnum_classes < 16 (specified in create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvmcreate_class_svm), the LUT requires 8 MB of storage with internal storage optimization. If NumClassesNumClassesNumClassesNumClassesnumClassesnum_classes = 1, the LUT requires only 2 MB of storage by using the full bit depth of the LUT. The runtime for the classification in classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLutclassify_image_class_lut becomes minimal if the LUT fits into the cache.

Typical values: 6,7,8

Default: 8

Restriction: '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.

'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection"

Method for the class selection for the LUT. Can be modified to control the accuracy and the runtime needed to create the LUT classifier. The value in 'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection" is ignored if the bit depth of the LUT is maximal, thus 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth" = 8 holds. 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. One of these clusters contains pixel combinations, where NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components denotes the dimension of the LUT, which is specified in create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvmcreate_class_svm。By choosing 'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection" = 'best'"best""best""best""best""best", the class that appears most often in the cluster is stored in the LUT. For 'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection" = 'fast'"fast""fast""fast""fast""fast", only one pixel of the cluster, i.e., the pixel with the smallest value (component-wise), is classified. The returned class is stored in the LUT. In this case, the accuracy of the subsequent classification could become lower. On the other hand, the runtime needed to create the LUT can be reduced, which is proportional to the maximal needed storage of the LUT, which is defined with

Possible values: 'fast'"fast""fast""fast""fast""fast", 'best'"best""best""best""best""best"

Default: 'fast'"fast""fast""fast""fast""fast"

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

SVMHandleSVMHandleSVMHandleSVMHandleSVMHandlesvmhandle (输入控制)  class_svm HClassSvm, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

SVM 句柄。

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

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

默认值: []

建议值: 'bit_depth'"bit_depth""bit_depth""bit_depth""bit_depth""bit_depth", 'class_selection'"class_selection""class_selection""class_selection""class_selection""class_selection"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制)  attribute.value-array HTupleSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

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

默认值: []

建议值: 8, 7, 6, 'fast'"fast""fast""fast""fast""fast", 'best'"best""best""best""best""best"

ClassLUTHandleClassLUTHandleClassLUTHandleClassLUTHandleclassLUTHandleclass_luthandle (输出控制)  class_lut HClassLUT, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the LUT classifier.

结果

如果参数有效,算子 create_class_lut_svmcreate_class_lut_svmCreateClassLutSvmCreateClassLutSvmCreateClassLutSvmcreate_class_lut_svm 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvmtrain_class_svm, read_class_svmread_class_svmReadClassSvmReadClassSvmReadClassSvmread_class_svm

可能的后继

classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLutclassify_image_class_lut

替代

create_class_lut_gmmcreate_class_lut_gmmCreateClassLutGmmCreateClassLutGmmCreateClassLutGmmcreate_class_lut_gmm, create_class_lut_knncreate_class_lut_knnCreateClassLutKnnCreateClassLutKnnCreateClassLutKnncreate_class_lut_knn, create_class_lut_mlpcreate_class_lut_mlpCreateClassLutMlpCreateClassLutMlpCreateClassLutMlpcreate_class_lut_mlp

另见

classify_image_class_lutclassify_image_class_lutClassifyImageClassLutClassifyImageClassLutClassifyImageClassLutclassify_image_class_lut, clear_class_lutclear_class_lutClearClassLutClearClassLutClearClassLutclear_class_lut

模块

基础