ClassesClassesClassesClasses | | | | Operators

trainf_ocr_class_mlp_protectedT_trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtected (Operator)

Name

trainf_ocr_class_mlp_protectedT_trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtected — Train an OCR classifier with data from a (protected) training file.

Signature

trainf_ocr_class_mlp_protected( : : OCRHandle, TrainingFile, Password, MaxIterations, WeightTolerance, ErrorTolerance : Error, ErrorLog)

Herror T_trainf_ocr_class_mlp_protected(const Htuple OCRHandle, const Htuple TrainingFile, const Htuple Password, const Htuple MaxIterations, const Htuple WeightTolerance, const Htuple ErrorTolerance, Htuple* Error, Htuple* ErrorLog)

Herror trainf_ocr_class_mlp_protected(const HTuple& OCRHandle, const HTuple& TrainingFile, const HTuple& Password, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* Error, HTuple* ErrorLog)

double HOCRMlp::TrainfOcrClassMlpProtected(const HTuple& TrainingFile, const HTuple& Password, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* ErrorLog) const

void TrainfOcrClassMlpProtected(const HTuple& OCRHandle, const HTuple& TrainingFile, const HTuple& Password, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* Error, HTuple* ErrorLog)

double HOCRMlp::TrainfOcrClassMlpProtected(const HTuple& TrainingFile, const HTuple& Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

double HOCRMlp::TrainfOcrClassMlpProtected(const HString& TrainingFile, const HString& Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

double HOCRMlp::TrainfOcrClassMlpProtected(const char* TrainingFile, const char* Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

void HOperatorSetX.TrainfOcrClassMlpProtected(
[in] VARIANT OCRHandle, [in] VARIANT TrainingFile, [in] VARIANT Password, [in] VARIANT MaxIterations, [in] VARIANT WeightTolerance, [in] VARIANT ErrorTolerance, [out] VARIANT* Error, [out] VARIANT* ErrorLog)

double HOCRMlpX.TrainfOcrClassMlpProtected(
[in] VARIANT TrainingFile, [in] VARIANT Password, [in] Hlong MaxIterations, [in] double WeightTolerance, [in] double ErrorTolerance, [out] VARIANT* ErrorLog)

static void HOperatorSet.TrainfOcrClassMlpProtected(HTuple OCRHandle, HTuple trainingFile, HTuple password, HTuple maxIterations, HTuple weightTolerance, HTuple errorTolerance, out HTuple error, out HTuple errorLog)

double HOCRMlp.TrainfOcrClassMlpProtected(HTuple trainingFile, HTuple password, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)

double HOCRMlp.TrainfOcrClassMlpProtected(string trainingFile, string password, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)

Description

trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtected trains the OCR classifier OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleOCRHandle with the training data stored in the OCR training files given by TrainingFileTrainingFileTrainingFileTrainingFileTrainingFiletrainingFile. Its functionality corresponds to the functionality of trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp, with the addition that trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtected can process unprotected and protected training files. Protected training files can be used only with the correct user password PasswordPasswordPasswordPasswordPasswordpassword. If the number of passwords PasswordPasswordPasswordPasswordPasswordpassword equals 1, then every input file TrainingFileTrainingFileTrainingFileTrainingFileTrainingFiletrainingFile 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_mlptrainf_ocr_class_mlpTrainfOcrClassMlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp. The concept of protecting OCR training data in HALCON is described in protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainf.

Parallelization

Parameters

OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleOCRHandle (input_control)  ocr_mlp HOCRMlp, HTupleHTupleHOCRMlp, HTupleHOCRMlpX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the OCR classifier.

TrainingFileTrainingFileTrainingFileTrainingFileTrainingFiletrainingFile (input_control)  filename.read(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the training files.

Default value: 'ocr.trf' "ocr.trf" "ocr.trf" "ocr.trf" "ocr.trf" "ocr.trf"

File extension: .trf, .otr

PasswordPasswordPasswordPasswordPasswordpassword (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Passwords for protected training files.

MaxIterationsMaxIterationsMaxIterationsMaxIterationsMaxIterationsmaxIterations (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Maximum number of iterations of the optimization algorithm.

Default value: 200

Suggested values: 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300

WeightToleranceWeightToleranceWeightToleranceWeightToleranceWeightToleranceweightTolerance (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Threshold for the difference of the weights of the MLP between two iterations of the optimization algorithm.

Default value: 1.0

Suggested values: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001

Restriction: WeightTolerance >= 1.0e-8

ErrorToleranceErrorToleranceErrorToleranceErrorToleranceErrorToleranceerrorTolerance (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Threshold for the difference of the mean error of the MLP on the training data between two iterations of the optimization algorithm.

Default value: 0.01

Suggested values: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001

Restriction: ErrorTolerance >= 1.0e-8

ErrorErrorErrorErrorErrorerror (output_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Mean error of the MLP on the training data.

ErrorLogErrorLogErrorLogErrorLogErrorLogerrorLog (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Mean error of the MLP on the training data as a function of the number of iterations of the optimization algorithm.

Result

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

trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtected may return the error 9211 (Matrix is not positive definite) if Preprocessing = 'canonical_variates'"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""normalization". Another solution can be to add more training samples.

Possible Predecessors

create_ocr_class_mlpcreate_ocr_class_mlpCreateOcrClassMlpcreate_ocr_class_mlpCreateOcrClassMlpCreateOcrClassMlp, write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainf, append_ocr_trainfappend_ocr_trainfAppendOcrTrainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainf, write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImage, protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainf

Possible Successors

do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlp, do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlp, write_ocr_class_mlpwrite_ocr_class_mlpWriteOcrClassMlpwrite_ocr_class_mlpWriteOcrClassMlpWriteOcrClassMlp

Alternatives

read_ocr_class_mlpread_ocr_class_mlpReadOcrClassMlpread_ocr_class_mlpReadOcrClassMlpReadOcrClassMlp

See also

trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp, train_class_mlptrain_class_mlpTrainClassMlptrain_class_mlpTrainClassMlpTrainClassMlp

Module

OCR/OCV


ClassesClassesClassesClasses | | | | Operators