Skip to content

close_ocrCloseOcrCloseOcrclose_ocrT_close_ocr🔗

Short description🔗

close_ocrCloseOcrCloseOcrclose_ocrT_close_ocr — Deallocation of the memory of an OCR classifier.

Warning🔗

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

Signature🔗

close_ocr( ocr_box OcrHandle )void CloseOcr( const HTuple& OcrHandle )static void HOperatorSet.CloseOcr( HTuple ocrHandle )def close_ocr( ocr_handle: HHandle ) -> None

Herror T_close_ocr( const Htuple OcrHandle )

void HOCRBox::CloseOcr( ) const

void HOCRBox.CloseOcr( )

Description🔗

The operator close_ocrCloseOcr deallocates the memory of the classifier having the number OcrHandleocrHandleocr_handle. Hereby all corresponding data will be deleted. However, if necessary, they can be saved in advance using the operator write_ocrWriteOcr. The number OcrHandleocrHandleocr_handle will be invalid after the call; but later the system can use it again for new classifiers.

Attention🔗

All data of the classifier will be deleted in main memory (not on the hard disk).

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 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🔗

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

ID of the OCR classifier to be deleted.

Example🔗

(C)

HTuple      OcrHandle,Class,Confidence\;
Hlong        orc_handle\;

read_ocr("testnet",&orc_handle)\;
/* image processing */
create_tuple(&OcrHandle,1)\;
set_i(OcrHandle,orc_handle,0)\;
T_do_ocr_multi(Character,Image,OcrHandle,&Class,&Confidence)\;
close_ocr(orc_handle)\;

Result🔗

If the parameter OcrHandleocrHandleocr_handle is valid, the operator close_ocrCloseOcr returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

write_ocr_trainfWriteOcrTrainf

Possible successors

read_ocrReadOcr

Module🔗

OCR/OCV