Skip to content

write_ocrWriteOcrWriteOcrwrite_ocrT_write_ocr🔗

Short description🔗

write_ocrWriteOcrWriteOcrwrite_ocrT_write_ocr — Writing an OCR classifier into a file.

Warning🔗

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

Signature🔗

write_ocr( ocr_box OcrHandle, filename.write FileName )void WriteOcr( const HTuple& OcrHandle, const HTuple& FileName )static void HOperatorSet.WriteOcr( HTuple ocrHandle, HTuple fileName )def write_ocr( ocr_handle: HHandle, file_name: str ) -> None

Herror T_write_ocr( const Htuple OcrHandle, const Htuple FileName )

void HOCRBox::WriteOcr( const HString& FileName ) const

void HOCRBox::WriteOcr( const char* FileName ) const

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

void HOCRBox.WriteOcr( string fileName )

Description🔗

The operator write_ocrWriteOcr writes the OCR classifier OcrHandleocrHandleocr_handle into the file FileNamefileNamefile_name. Since the data of the classifier will be lost when the program is finished, they have to be stored after the training if the user wants to use them again at a later execution of the program. The data can then be read with the help of the operator read_ocrReadOcr. The extension will be added automatically to the parameter FileNamefileNamefile_name.

Attention🔗

The output file FileNamefileNamefile_name must be given without extension.

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🔗

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

ID of the OCR classifier.

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

Name of the file for the OCR classifier (without extension).

Default: 'my_ocr'"my_ocr"
File extension: .obc

Result🔗

If the parameter OcrHandleocrHandleocr_handle is valid and the indicated file can be written, the operator write_ocrWriteOcr returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

traind_ocr_class_boxTraindOcrClassBox, trainf_ocr_class_boxTrainfOcrClassBox

Possible successors

do_ocr_multiDoOcrMulti, do_ocr_singleDoOcrSingle

See also

read_ocrReadOcr, do_ocr_multiDoOcrMulti, traind_ocr_class_boxTraindOcrClassBox, trainf_ocr_class_boxTrainfOcrClassBox

Module🔗

OCR/OCV