Skip to content

read_ocrReadOcrReadOcrread_ocrT_read_ocr🔗

Short description🔗

read_ocrReadOcrReadOcrread_ocrT_read_ocr — Read an OCR classifier from a file.

Warning🔗

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

Signature🔗

read_ocr( filename.read FileName, out ocr_box OcrHandle )void ReadOcr( const HTuple& FileName, HTuple* OcrHandle )static void HOperatorSet.ReadOcr( HTuple fileName, out HTuple ocrHandle )def read_ocr( file_name: str ) -> HHandle

Herror T_read_ocr( const Htuple FileName, Htuple* OcrHandle )

void HOCRBox::HOCRBox( const HString& FileName )

void HOCRBox::HOCRBox( const char* FileName )

void HOCRBox::HOCRBox( const wchar_t* FileName ) (Windows only)

public HOCRBox( string fileName )

void HOCRBox::ReadOcr( const HString& FileName )

void HOCRBox::ReadOcr( const char* FileName )

void HOCRBox::ReadOcr( const wchar_t* FileName ) (Windows only)

void HOCRBox.ReadOcr( string fileName )

Description🔗

The operator read_ocrReadOcr reads an OCR classifier from a file FileNamefileNamefile_name. This file will hereby be searched in the directory ($HALCONROOT/ocr/) as well as in the currently used directory. If too many classifiers have been loaded, an error message will be displayed.

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.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

FileNamefileNamefile_name (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the OCR classifier file.

Default: 'testnet'"testnet"
File extension: .obc, .fnt

OcrHandleocrHandleocr_handle (output_control) ocr_box → (handle)HTuple (HHandle)HOCRBox, HTuple (IntPtr)HHandleHtuple (handle)

ID of the read OCR classifier.

Result🔗

If the indicated file is available and the format is correct, the operator read_ocrReadOcr returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

reset_obj_dbResetObjDb

Possible successors

do_ocr_multiDoOcrMulti, do_ocr_singleDoOcrSingle, traind_ocr_class_boxTraindOcrClassBox, trainf_ocr_class_boxTrainfOcrClassBox

See also

write_ocrWriteOcr, do_ocr_multiDoOcrMulti, traind_ocr_class_boxTraindOcrClassBox, trainf_ocr_class_boxTrainfOcrClassBox

Module🔗

OCR/OCV