trainf_ocr_class_svm_protectedT_trainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected (Operator)
Name
trainf_ocr_class_svm_protectedT_trainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected
— Train an OCR classifier with data from a (protected) training file.
Signature
void TrainfOcrClassSvmProtected(const HTuple& OCRHandle, const HTuple& TrainingFile, const HTuple& Password, const HTuple& Epsilon, const HTuple& TrainMode)
void HOCRSvm::TrainfOcrClassSvmProtected(const HTuple& TrainingFile, const HTuple& Password, double Epsilon, const HTuple& TrainMode) const
void HOCRSvm::TrainfOcrClassSvmProtected(const HString& TrainingFile, const HString& Password, double Epsilon, const HString& TrainMode) const
void HOCRSvm::TrainfOcrClassSvmProtected(const char* TrainingFile, const char* Password, double Epsilon, const char* TrainMode) const
void HOCRSvm::TrainfOcrClassSvmProtected(const wchar_t* TrainingFile, const wchar_t* Password, double Epsilon, const wchar_t* TrainMode) const
(Windows only)
static void HOperatorSet.TrainfOcrClassSvmProtected(HTuple OCRHandle, HTuple trainingFile, HTuple password, HTuple epsilon, HTuple trainMode)
void HOCRSvm.TrainfOcrClassSvmProtected(HTuple trainingFile, HTuple password, double epsilon, HTuple trainMode)
void HOCRSvm.TrainfOcrClassSvmProtected(string trainingFile, string password, double epsilon, string trainMode)
Description
trainf_ocr_class_svm_protectedtrainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected
trains the OCR classifier
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle
with the training data stored in the OCR
training files given by TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile
. Its functionality
corresponds to the functionality of trainf_ocr_class_svmtrainf_ocr_class_svmTrainfOcrClassSvmTrainfOcrClassSvmTrainfOcrClassSvm
,
with the addition that trainf_ocr_class_svm_protectedtrainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected
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
trainf_ocr_class_svmtrainf_ocr_class_svmTrainfOcrClassSvmTrainfOcrClassSvmTrainfOcrClassSvm
. The concept of protecting OCR training
data in HALCON is described in protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainf
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator modifies the state of the following input parameter:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
Parameters
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle
(input_control, state is modified) ocr_svm →
HOCRSvm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the OCR classifier.
TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile
(input_control) filename.read(-array) →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Names of the training files.
Default value:
'ocr.trf'
"ocr.trf"
"ocr.trf"
"ocr.trf"
"ocr.trf"
File extension: .trf
, .otr
PasswordPasswordPasswordPasswordpassword
(input_control) string(-array) →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Passwords for protected training files.
EpsilonEpsilonEpsilonEpsilonepsilon
(input_control) real →
HTupleHTupleHtuple (real) (double) (double) (double)
Stop parameter for training.
Default value: 0.001
Suggested values: 0.00001, 0.0001, 0.001, 0.01, 0.1
TrainModeTrainModeTrainModeTrainModetrainMode
(input_control) number →
HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Mode of training.
Default value:
'default'
"default"
"default"
"default"
"default"
List of values: 'add_sv_to_train_set'"add_sv_to_train_set""add_sv_to_train_set""add_sv_to_train_set""add_sv_to_train_set", 'default'"default""default""default""default"
Result
If the parameters are valid the operator
trainf_ocr_class_svm_protectedtrainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected
returns the value 2 (H_MSG_TRUE). If necessary,
an exception is raised.
trainf_ocr_class_svm_protectedtrainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtected
may return the error 9211 (Matrix is
not positive definite) if Preprocessing
=
'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates" is used. This typically indicates
that not enough training samples have been stored for each class.
In this case we recommend to change Preprocessing
to
'normalization'"normalization""normalization""normalization""normalization". Another solution can be to add more
training samples.
Possible Predecessors
create_ocr_class_svmcreate_ocr_class_svmCreateOcrClassSvmCreateOcrClassSvmCreateOcrClassSvm
,
write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainf
,
append_ocr_trainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainfAppendOcrTrainf
,
write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImageWriteOcrTrainfImage
,
protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainf
Possible Successors
do_ocr_single_class_svmdo_ocr_single_class_svmDoOcrSingleClassSvmDoOcrSingleClassSvmDoOcrSingleClassSvm
,
do_ocr_multi_class_svmdo_ocr_multi_class_svmDoOcrMultiClassSvmDoOcrMultiClassSvmDoOcrMultiClassSvm
,
write_ocr_class_svmwrite_ocr_class_svmWriteOcrClassSvmWriteOcrClassSvmWriteOcrClassSvm
Alternatives
read_ocr_class_svmread_ocr_class_svmReadOcrClassSvmReadOcrClassSvmReadOcrClassSvm
See also
trainf_ocr_class_svmtrainf_ocr_class_svmTrainfOcrClassSvmTrainfOcrClassSvmTrainfOcrClassSvm
,
train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm
Module
OCR/OCV