write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImagewrite_ocr_trainf_image (Operator)

Name

write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImagewrite_ocr_trainf_image — Write characters into a training file.

Signature

write_ocr_trainf_image(Character : : Class, TrainingFile : )

Herror write_ocr_trainf_image(const Hobject Character, const char* Class, const char* TrainingFile)

Herror T_write_ocr_trainf_image(const Hobject Character, const Htuple Class, const Htuple TrainingFile)

void WriteOcrTrainfImage(const HObject& Character, const HTuple& Class, const HTuple& TrainingFile)

void HImage::WriteOcrTrainfImage(const HTuple& Class, const HString& TrainingFile) const

void HImage::WriteOcrTrainfImage(const HString& Class, const HString& TrainingFile) const

void HImage::WriteOcrTrainfImage(const char* Class, const char* TrainingFile) const

void HImage::WriteOcrTrainfImage(const wchar_t* Class, const wchar_t* TrainingFile) const   (Windows only)

static void HOperatorSet.WriteOcrTrainfImage(HObject character, HTuple classVal, HTuple trainingFile)

void HImage.WriteOcrTrainfImage(HTuple classVal, string trainingFile)

void HImage.WriteOcrTrainfImage(string classVal, string trainingFile)

def write_ocr_trainf_image(character: HObject, class_val: MaybeSequence[str], training_file: str) -> None

Description

The operator write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImageWriteOcrTrainfImagewrite_ocr_trainf_image is used to prepare the training with the operator trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp or trainf_ocr_class_svmtrainf_ocr_class_svmTrainfOcrClassSvmTrainfOcrClassSvmTrainfOcrClassSvmtrainf_ocr_class_svm. Hereby regions, representing characters, including their gray values (region and pixel) and the corresponding class name will be written into a file. An arbitrary number of regions within one image is supported. For each character (region) in CharacterCharacterCharacterCharactercharactercharacter the corresponding class name must be specified in ClassClassClassClassclassValclass. If no file extension is specified in TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file the extension '.trf' is appended to the file name. In contrast to write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf one image per character is passed. The domain of this image defines the pixels which belong to the character. The file format can be defined by the parameter 'ocr_trainf_version'"ocr_trainf_version""ocr_trainf_version""ocr_trainf_version""ocr_trainf_version""ocr_trainf_version" of the operator set_systemset_systemSetSystemSetSystemSetSystemset_system.

Execution Information

Parameters

CharacterCharacterCharacterCharactercharactercharacter (input_object)  singlechannelimage(-array) objectHImageHObjectHImageHobject (byte / uint2)

Characters to be trained.

ClassClassClassClassclassValclass (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Class (name) of the characters.

TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the training file.

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

File extension: .trf

Result

If the parameters are correct, the operator write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImageWriteOcrTrainfImagewrite_ocr_trainf_image returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThresholdthreshold, connectionconnectionConnectionConnectionConnectionconnection, read_ocr_trainfread_ocr_trainfReadOcrTrainfReadOcrTrainfReadOcrTrainfread_ocr_trainf

Possible Successors

trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp, trainf_ocr_class_svmtrainf_ocr_class_svmTrainfOcrClassSvmTrainfOcrClassSvmTrainfOcrClassSvmtrainf_ocr_class_svm

Alternatives

write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf, append_ocr_trainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainfAppendOcrTrainfappend_ocr_trainf

Module

OCR/OCV