HALCON Reference Manual 10.0.2
Name
trainf_ocr_class_mlpT_trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp — Train an OCR classifier.
Herror trainf_ocr_class_mlp(const HTuple& OCRHandle, const HTuple& TrainingFile, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* Error, HTuple* ErrorLog)
double HOCRMlp::TrainfOcrClassMlp(const HTuple& TrainingFile, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* ErrorLog) const
void HOperatorSetX.TrainfOcrClassMlp(
[in] VARIANT OCRHandle, [in] VARIANT TrainingFile, [in] VARIANT MaxIterations, [in] VARIANT WeightTolerance, [in] VARIANT ErrorTolerance, [out] VARIANT* Error, [out] VARIANT* ErrorLog)
double HOCRMlpX.TrainfOcrClassMlp(
[in] VARIANT TrainingFile, [in] Hlong MaxIterations, [in] double WeightTolerance, [in] double ErrorTolerance, [out] VARIANT* ErrorLog)
static void HOperatorSet.TrainfOcrClassMlp(HTuple OCRHandle, HTuple trainingFile, HTuple maxIterations, HTuple weightTolerance, HTuple errorTolerance, out HTuple error, out HTuple errorLog)
double HOCRMlp.TrainfOcrClassMlp(HTuple trainingFile, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)
double HOCRMlp.TrainfOcrClassMlp(string trainingFile, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)
trainf_ocr_class_mlptrainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp trains the OCR classifier
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle with the training characters stored in the OCR
training files given by TrainingFileTrainingFileTrainingFileTrainingFiletrainingFile. The training files
must have been created, e.g., using write_ocr_trainfwrite_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainf, before
calling trainf_ocr_class_mlptrainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp. The remaining parameters have
the same meaning as in train_class_mlptrain_class_mlptrain_class_mlpTrainClassMlpTrainClassMlp and are described in
detail with train_class_mlptrain_class_mlptrain_class_mlpTrainClassMlpTrainClassMlp. Please, note that training characters
that have no corresponding class in the classifier OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle are
discarded.
- Multithreading type: exclusive (runs in parallel only with independent operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Handle of the OCR classifier.
Name(s) of the training file(s).
Default value:
'ocr.trf'
"ocr.trf"
"ocr.trf"
"ocr.trf"
"ocr.trf"
File extension: .trf
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
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
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
Mean error of the MLP on the training data.
Mean error of the MLP on the training data as a
function of the number of iterations of the
optimization algorithm.
* Train an OCR classifier
read_ocr_trainf_names ('ocr.trf', CharacterNames, CharacterCount)
create_ocr_class_mlp (8, 10, 'constant', 'default', CharacterNames, 80, \
'none', 81, 42, OCRHandle)
trainf_ocr_class_mlp (OCRHandle, 'ocr.trf', 100, 1, 0.01, Error, ErrorLog)
write_ocr_class_mlp (OCRHandle, 'ocr.omc')
clear_ocr_class_mlp (OCRHandle)
If the parameters are valid, the operator
trainf_ocr_class_mlptrainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp returns the value 2 (H_MSG_TRUE). If necessary
an exception is raised.
trainf_ocr_class_mlptrainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlp 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.
create_ocr_class_mlpcreate_ocr_class_mlpcreate_ocr_class_mlpCreateOcrClassMlpCreateOcrClassMlp,
write_ocr_trainfwrite_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainf,
append_ocr_trainfappend_ocr_trainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainf,
write_ocr_trainf_imagewrite_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImage
do_ocr_single_class_mlpdo_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlp,
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlp,
write_ocr_class_mlpwrite_ocr_class_mlpwrite_ocr_class_mlpWriteOcrClassMlpWriteOcrClassMlp
read_ocr_class_mlpread_ocr_class_mlpread_ocr_class_mlpReadOcrClassMlpReadOcrClassMlp
train_class_mlptrain_class_mlptrain_class_mlpTrainClassMlpTrainClassMlp
OCR/OCV
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |