close_ocrT_close_ocrCloseOcrCloseOcrclose_ocr (算子)

名称

close_ocrT_close_ocrCloseOcrCloseOcrclose_ocr — 取消 OCR 分类器的内存分配。

警告

close_ocrclose_ocrCloseOcrCloseOcrCloseOcrclose_ocr 已过时,仅出于向后兼容性考虑而保留。 New applications should use the MLP, SVM or CNN based operators instead.

签名

close_ocr( : : OcrHandle : )

Herror T_close_ocr(const Htuple OcrHandle)

void CloseOcr(const HTuple& OcrHandle)

void HOCRBox::CloseOcr() const

static void HOperatorSet.CloseOcr(HTuple ocrHandle)

void HOCRBox.CloseOcr()

def close_ocr(ocr_handle: HHandle) -> None

描述

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

注意

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

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

OcrHandleOcrHandleOcrHandleOcrHandleocrHandleocr_handle (输入控制,状态被修改)  ocr_box HOCRBox, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

ID of the OCR classifier to be deleted.

示例(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);

结果

If the parameter OcrHandleOcrHandleOcrHandleOcrHandleocrHandleocr_handle is valid, the operator close_ocrclose_ocrCloseOcrCloseOcrCloseOcrclose_ocr 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf

可能的后继

read_ocrread_ocrReadOcrReadOcrReadOcrread_ocr

模块

光学字符识别/光学字符验证