trainf_ocr_class_boxT_trainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBox (Operator)

Name

trainf_ocr_class_boxT_trainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBox — Train an OCR classifier with the help of a training file.

Warning

trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBoxTrainfOcrClassBox is obsolete and is only provided for reasons of backward compatibility. New applications should use the MLP, SVM or CNN based operators instead.

Signature

trainf_ocr_class_box( : : OcrHandle, TrainingFile : AvgConfidence)

Herror T_trainf_ocr_class_box(const Htuple OcrHandle, const Htuple TrainingFile, Htuple* AvgConfidence)

void TrainfOcrClassBox(const HTuple& OcrHandle, const HTuple& TrainingFile, HTuple* AvgConfidence)

double HOCRBox::TrainfOcrClassBox(const HTuple& TrainingFile) const

double HOCRBox::TrainfOcrClassBox(const HString& TrainingFile) const

double HOCRBox::TrainfOcrClassBox(const char* TrainingFile) const

double HOCRBox::TrainfOcrClassBox(const wchar_t* TrainingFile) const   (Windows only)

static void HOperatorSet.TrainfOcrClassBox(HTuple ocrHandle, HTuple trainingFile, out HTuple avgConfidence)

double HOCRBox.TrainfOcrClassBox(HTuple trainingFile)

double HOCRBox.TrainfOcrClassBox(string trainingFile)

Description

The operator trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBoxTrainfOcrClassBox trains the classifier OcrHandleOcrHandleOcrHandleOcrHandleocrHandle via the indicated training files. Any number of files can be indicated. The parameter AvgConfidenceAvgConfidenceAvgConfidenceAvgConfidenceavgConfidence provides information about the success of the training: It contains the average confidence of the trained characters measured by a re-classification. The confidence of mismatched characters is set to 0 (thus, the average confidence will be decreased significantly). Please, note that training characters that have no corresponding class in the classifier OcrHandleOcrHandleOcrHandleOcrHandleocrHandle are discarded.

Attention

The names of the characters in the file must fit the network.

Execution Information

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_box HOCRBox, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

ID of the desired OCR-network.

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

Names of the training files.

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

File extension: .trf, .otr

AvgConfidenceAvgConfidenceAvgConfidenceAvgConfidenceavgConfidence (output_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Average confidence during a re-classification of the trained characters.

Example (C)

HTuple  TrainingFile, OcrHandle, AvgConfidence;
T_create_ocr_class_box(WidthPattern,HeightPattern,Interpolation,
                    Features,\Character,&OcrHandle);
create_tuple(&TrainingFile,2);
set_s(TrainingFile,"data1",0);
set_s(TrainingFile,"data2",1);
T_trainf_ocr_class_box(OcrHandle,TrainingFile,&AvgConfidence);

Result

If the file name is correct and the data fit the network, the operator trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBoxTrainfOcrClassBox returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Possible Predecessors

create_ocr_class_boxcreate_ocr_class_boxCreateOcrClassBoxCreateOcrClassBoxCreateOcrClassBox, read_ocrread_ocrReadOcrReadOcrReadOcr

Possible Successors

traind_ocr_class_boxtraind_ocr_class_boxTraindOcrClassBoxTraindOcrClassBoxTraindOcrClassBox, write_ocrwrite_ocrWriteOcrWriteOcrWriteOcr, do_ocr_multido_ocr_multiDoOcrMultiDoOcrMultiDoOcrMulti, do_ocr_singledo_ocr_singleDoOcrSingleDoOcrSingleDoOcrSingle

Alternatives

traind_ocr_class_boxtraind_ocr_class_boxTraindOcrClassBoxTraindOcrClassBoxTraindOcrClassBox

Module

OCR/OCV