ClassesClasses | | Operators

select_feature_set_trainf_svm_protectedT_select_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtected (Operator)

Name

select_feature_set_trainf_svm_protectedT_select_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtected — Select an optimal combination of features to classify OCR data from a (protected) training file.

Signature

select_feature_set_trainf_svm_protected( : : TrainingFile, Password, FeatureList, SelectionMethod, Width, Height, GenParamName, GenParamValue : OCRHandle, FeatureSet, Score)

Herror T_select_feature_set_trainf_svm_protected(const Htuple TrainingFile, const Htuple Password, const Htuple FeatureList, const Htuple SelectionMethod, const Htuple Width, const Htuple Height, const Htuple GenParamName, const Htuple GenParamValue, Htuple* OCRHandle, Htuple* FeatureSet, Htuple* Score)

void SelectFeatureSetTrainfSvmProtected(const HTuple& TrainingFile, const HTuple& Password, const HTuple& FeatureList, const HTuple& SelectionMethod, const HTuple& Width, const HTuple& Height, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* OCRHandle, HTuple* FeatureSet, HTuple* Score)

HTuple HOCRSvm::SelectFeatureSetTrainfSvmProtected(const HTuple& TrainingFile, const HTuple& Password, const HTuple& FeatureList, const HString& SelectionMethod, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Score)

HTuple HOCRSvm::SelectFeatureSetTrainfSvmProtected(const HString& TrainingFile, const HString& Password, const HString& FeatureList, const HString& SelectionMethod, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Score)

HTuple HOCRSvm::SelectFeatureSetTrainfSvmProtected(const char* TrainingFile, const char* Password, const char* FeatureList, const char* SelectionMethod, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Score)

static void HOperatorSet.SelectFeatureSetTrainfSvmProtected(HTuple trainingFile, HTuple password, HTuple featureList, HTuple selectionMethod, HTuple width, HTuple height, HTuple genParamName, HTuple genParamValue, out HTuple OCRHandle, out HTuple featureSet, out HTuple score)

HTuple HOCRSvm.SelectFeatureSetTrainfSvmProtected(HTuple trainingFile, HTuple password, HTuple featureList, string selectionMethod, int width, int height, HTuple genParamName, HTuple genParamValue, out HTuple score)

HTuple HOCRSvm.SelectFeatureSetTrainfSvmProtected(string trainingFile, string password, string featureList, string selectionMethod, int width, int height, HTuple genParamName, HTuple genParamValue, out HTuple score)

Description

select_feature_set_trainf_svm_protectedselect_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtected selects an optimal combination of features to classify the data given in the training files TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile with a support vector machine (SVM). Its functionality corresponds to the functionality of select_feature_set_trainf_svmselect_feature_set_trainf_svmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvm, with the addition that select_feature_set_trainf_svm_protectedselect_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtected can process unprotected and protected training files. Protected training files can be used only with the correct user password PasswordPasswordPasswordPasswordpassword. If the number of passwords PasswordPasswordPasswordPasswordpassword equals 1, then every input file TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile is checked with that password, otherwise the number of passwords has to be equal to the number of input files and the input file at position n is checked with the password at position n. For unprotected training files the passwords are ignored.

For a more detailed description of the operator's functionality see select_feature_set_trainf_svmselect_feature_set_trainf_svmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvm. The concept of protecting OCR training data in HALCON is described in protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainf.

Attention

This operator may take considerable time, depending on the size of the data set in the training file, and the number of features.

Please note, that this operator should not be called, if only a small set of training data is available. Due to the risk of overfitting the operator select_feature_set_trainf_svm_protectedselect_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtected may deliver a classifier with a very high score. However, the classifier may perfom poorly when tested.

Execution Information

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

TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile (input_control)  filename.read(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Names of the training files.

Default value: '' "" "" "" ""

File extension: .trf, .otr

PasswordPasswordPasswordPasswordpassword (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Passwords for protected training files.

FeatureListFeatureListFeatureListFeatureListfeatureList (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

List of features that should be considered for selection.

Default value: ['zoom_factor','ratio','width','height','foreground','foreground_grid_9','foreground_grid_16','anisometry','compactness','convexity','moments_region_2nd_invar','moments_region_2nd_rel_invar','moments_region_3rd_invar','moments_central','phi','num_connect','num_holes','projection_horizontal','projection_vertical','projection_horizontal_invar','projection_vertical_invar','chord_histo','num_runs','pixel','pixel_invar','pixel_binary','gradient_8dir','cooc','moments_gray_plane'] ["zoom_factor","ratio","width","height","foreground","foreground_grid_9","foreground_grid_16","anisometry","compactness","convexity","moments_region_2nd_invar","moments_region_2nd_rel_invar","moments_region_3rd_invar","moments_central","phi","num_connect","num_holes","projection_horizontal","projection_vertical","projection_horizontal_invar","projection_vertical_invar","chord_histo","num_runs","pixel","pixel_invar","pixel_binary","gradient_8dir","cooc","moments_gray_plane"] ["zoom_factor","ratio","width","height","foreground","foreground_grid_9","foreground_grid_16","anisometry","compactness","convexity","moments_region_2nd_invar","moments_region_2nd_rel_invar","moments_region_3rd_invar","moments_central","phi","num_connect","num_holes","projection_horizontal","projection_vertical","projection_horizontal_invar","projection_vertical_invar","chord_histo","num_runs","pixel","pixel_invar","pixel_binary","gradient_8dir","cooc","moments_gray_plane"] ["zoom_factor","ratio","width","height","foreground","foreground_grid_9","foreground_grid_16","anisometry","compactness","convexity","moments_region_2nd_invar","moments_region_2nd_rel_invar","moments_region_3rd_invar","moments_central","phi","num_connect","num_holes","projection_horizontal","projection_vertical","projection_horizontal_invar","projection_vertical_invar","chord_histo","num_runs","pixel","pixel_invar","pixel_binary","gradient_8dir","cooc","moments_gray_plane"] ["zoom_factor","ratio","width","height","foreground","foreground_grid_9","foreground_grid_16","anisometry","compactness","convexity","moments_region_2nd_invar","moments_region_2nd_rel_invar","moments_region_3rd_invar","moments_central","phi","num_connect","num_holes","projection_horizontal","projection_vertical","projection_horizontal_invar","projection_vertical_invar","chord_histo","num_runs","pixel","pixel_invar","pixel_binary","gradient_8dir","cooc","moments_gray_plane"]

List of values: 'anisometry'"anisometry""anisometry""anisometry""anisometry", 'chord_histo'"chord_histo""chord_histo""chord_histo""chord_histo", 'compactness'"compactness""compactness""compactness""compactness", 'convexity'"convexity""convexity""convexity""convexity", 'cooc'"cooc""cooc""cooc""cooc", 'default'"default""default""default""default", 'foreground'"foreground""foreground""foreground""foreground", 'foreground_grid_16'"foreground_grid_16""foreground_grid_16""foreground_grid_16""foreground_grid_16", 'foreground_grid_9'"foreground_grid_9""foreground_grid_9""foreground_grid_9""foreground_grid_9", 'gradient_8dir'"gradient_8dir""gradient_8dir""gradient_8dir""gradient_8dir", 'height'"height""height""height""height", 'moments_central'"moments_central""moments_central""moments_central""moments_central", 'moments_gray_plane'"moments_gray_plane""moments_gray_plane""moments_gray_plane""moments_gray_plane", 'moments_region_2nd_invar'"moments_region_2nd_invar""moments_region_2nd_invar""moments_region_2nd_invar""moments_region_2nd_invar", 'moments_region_2nd_rel_invar'"moments_region_2nd_rel_invar""moments_region_2nd_rel_invar""moments_region_2nd_rel_invar""moments_region_2nd_rel_invar", 'moments_region_3rd_invar'"moments_region_3rd_invar""moments_region_3rd_invar""moments_region_3rd_invar""moments_region_3rd_invar", 'num_connect'"num_connect""num_connect""num_connect""num_connect", 'num_holes'"num_holes""num_holes""num_holes""num_holes", 'num_runs'"num_runs""num_runs""num_runs""num_runs", 'phi'"phi""phi""phi""phi", 'pixel'"pixel""pixel""pixel""pixel", 'pixel_binary'"pixel_binary""pixel_binary""pixel_binary""pixel_binary", 'pixel_invar'"pixel_invar""pixel_invar""pixel_invar""pixel_invar", 'projection_horizontal'"projection_horizontal""projection_horizontal""projection_horizontal""projection_horizontal", 'projection_horizontal_invar'"projection_horizontal_invar""projection_horizontal_invar""projection_horizontal_invar""projection_horizontal_invar", 'projection_vertical'"projection_vertical""projection_vertical""projection_vertical""projection_vertical", 'projection_vertical_invar'"projection_vertical_invar""projection_vertical_invar""projection_vertical_invar""projection_vertical_invar", 'ratio'"ratio""ratio""ratio""ratio", 'width'"width""width""width""width", 'zoom_factor'"zoom_factor""zoom_factor""zoom_factor""zoom_factor"

SelectionMethodSelectionMethodSelectionMethodSelectionMethodselectionMethod (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Method to perform the selection.

Default value: 'greedy' "greedy" "greedy" "greedy" "greedy"

List of values: 'greedy'"greedy""greedy""greedy""greedy", 'greedy_oscillating'"greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating"

WidthWidthWidthWidthwidth (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the rectangle to which the gray values of the segmented character are zoomed.

Default value: 15

HeightHeightHeightHeightheight (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the rectangle to which the gray values of the segmented character are zoomed.

Default value: 16

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  string-array HTupleHTupleHtuple (string) (string) (HString) (char*)

Names of generic parameters to configure the selection process and the classifier.

Default value: []

List of values: 'gamma'"gamma""gamma""gamma""gamma", 'nu'"nu""nu""nu""nu"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  number-array HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Values of generic parameters to configure the selection process and the classifier.

Default value: []

Suggested values: 'auto'"auto""auto""auto""auto", '0.1'"0.1""0.1""0.1""0.1", '0.3'"0.3""0.3""0.3""0.3"

OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle (output_control)  ocr_svm HOCRSvm, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Trained OCR-SVM Classifier.

FeatureSetFeatureSetFeatureSetFeatureSetfeatureSet (output_control)  string-array HTupleHTupleHtuple (string) (string) (HString) (char*)

Selected feature set, contains only entries from FeatureListFeatureListFeatureListFeatureListfeatureList.

ScoreScoreScoreScorescore (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Achieved score using tow-fold cross-validation.

Result

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

Possible Predecessors

protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainf

Alternatives

select_feature_set_trainf_mlp_protectedselect_feature_set_trainf_mlp_protectedSelectFeatureSetTrainfMlpProtectedSelectFeatureSetTrainfMlpProtectedSelectFeatureSetTrainfMlpProtected

See also

select_feature_set_trainf_svmselect_feature_set_trainf_svmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvm, select_feature_set_svmselect_feature_set_svmSelectFeatureSetSvmSelectFeatureSetSvmSelectFeatureSetSvm

Module

OCR/OCV


ClassesClasses | | Operators