Skip to content

read_ocr_trainfReadOcrTrainfReadOcrTrainfread_ocr_trainfT_read_ocr_trainf🔗

Short description🔗

read_ocr_trainfReadOcrTrainfReadOcrTrainfread_ocr_trainfT_read_ocr_trainf — Read training characters from files and convert to images.

Signature🔗

read_ocr_trainf( out image Characters, filename.read TrainingFile, out string CharacterNames )void ReadOcrTrainf( HObject* Characters, const HTuple& TrainingFile, HTuple* CharacterNames )static void HOperatorSet.ReadOcrTrainf( out HObject characters, HTuple trainingFile, out HTuple characterNames )def read_ocr_trainf( training_file: MaybeSequence[str] ) -> Tuple[HObject, Sequence[str]]

Herror T_read_ocr_trainf( Hobject* Characters, const Htuple TrainingFile, Htuple* CharacterNames )

HTuple HImage::ReadOcrTrainf( const HTuple& TrainingFile )

HTuple HImage::ReadOcrTrainf( const HString& TrainingFile )

HTuple HImage::ReadOcrTrainf( const char* TrainingFile )

HTuple HImage::ReadOcrTrainf( const wchar_t* TrainingFile ) (Windows only)

HTuple HImage.ReadOcrTrainf( HTuple trainingFile )

HTuple HImage.ReadOcrTrainf( string trainingFile )

Description🔗

read_ocr_trainfReadOcrTrainf reads all characters from the specified file names and converts them into images. The default HALCON file extension for the OCR training file is 'trf'. The domain is defined according to the foreground of the characters (as specified in write_ocr_trainfWriteOcrTrainf). The names of the characters are returned in CharacterNamescharacterNamescharacter_names. If more than one file name is given the files are processed in the order of the file names.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Characterscharacterscharacters (output_object) image-array → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

Images read from file.

TrainingFiletrainingFiletraining_file (input_control) filename.read(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Names of the training files.

Default: ''""
File extension: .trf, .otr

CharacterNamescharacterNamescharacter_names (output_control) string-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Names of the read characters.

Result🔗

If the parameter values are correct the operator read_ocr_trainfReadOcrTrainf returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

write_ocr_trainfWriteOcrTrainf

Possible successors

disp_imageDispImage, select_objSelectObj, zoom_image_sizeZoomImageSize

Alternatives

read_ocr_trainf_selectReadOcrTrainfSelect

Module🔗

OCR/OCV