create_deep_ocrT_create_deep_ocrCreateDeepOcrCreateDeepOcrcreate_deep_ocr创建深度光学字符识别(算子)
名称
create_deep_ocrT_create_deep_ocrCreateDeepOcrCreateDeepOcrcreate_deep_ocr — 创建深度 OCR 模型。
签名
void CreateDeepOcr(const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DeepOcrHandle)
void HDlModelOcr::HDlModelOcr(const HTuple& GenParamName, const HTuple& GenParamValue)
void HDlModelOcr::HDlModelOcr(const HString& GenParamName, const HString& GenParamValue)
void HDlModelOcr::HDlModelOcr(const char* GenParamName, const char* GenParamValue)
void HDlModelOcr::HDlModelOcr(const wchar_t* GenParamName, const wchar_t* GenParamValue)
(
Windows only)
void HDlModelOcr::CreateDeepOcr(const HTuple& GenParamName, const HTuple& GenParamValue)
void HDlModelOcr::CreateDeepOcr(const HString& GenParamName, const HString& GenParamValue)
void HDlModelOcr::CreateDeepOcr(const char* GenParamName, const char* GenParamValue)
void HDlModelOcr::CreateDeepOcr(const wchar_t* GenParamName, const wchar_t* GenParamValue)
(
Windows only)
描述
create_deep_ocrcreate_deep_ocrCreateDeepOcrCreateDeepOcrCreateDeepOcrcreate_deep_ocr 利用预训练组件创建深度 OCR 模型,并将模型句柄存储于 DeepOcrHandleDeepOcrHandleDeepOcrHandleDeepOcrHandledeepOcrHandledeep_ocr_handle中。该句柄包含运行推理所需的所有参数。
深度 OCR 模型通常由两个组件构成,默认在目录 $HALCONROOT/dl/ 中搜索:
可通过 GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 及对应的
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value 设置以下选项:
- 'mode'"mode""mode""mode""mode""mode":
-
指定模式及相应执行的组件。支持值:
- 'detection'"detection""detection""detection""detection""detection":
仅执行检测部分。因此模型仅定位图像中的文字区域。
- 'recognition'"recognition""recognition""recognition""recognition""recognition":
仅执行识别部分。因此模型要求图像仅包含文字的紧密裁剪区域。
- 'auto'"auto""auto""auto""auto""auto":
同时执行单词检测与识别两部分。
默认值:
'auto'"auto""auto""auto""auto""auto"。
模型可通过其识别组件识别的字符集,可使用 get_deep_ocr_paramget_deep_ocr_paramGetDeepOcrParamGetDeepOcrParamGetDeepOcrParamget_deep_ocr_param 配合
'recognition_alphabet'"recognition_alphabet""recognition_alphabet""recognition_alphabet""recognition_alphabet""recognition_alphabet" 参数进行检索。
要了解深度 OCR 工作流的概述,请参阅 OCR / Deep OCR。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。
参数
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) attribute.name(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
泛型参数的名称。
默认值:
[]
值列表:
'mode'"mode""mode""mode""mode""mode"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制) attribute.value(-array) → HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
泛型参数的值。
默认值:
[]
值列表:
'auto'"auto""auto""auto""auto""auto", 'detection'"detection""detection""detection""detection""detection", 'recognition'"recognition""recognition""recognition""recognition""recognition"
DeepOcrHandleDeepOcrHandleDeepOcrHandleDeepOcrHandledeepOcrHandledeep_ocr_handle (输出控制) deep_ocr → HDlModelOcr, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
深度 OCR 模型的句柄。
结果
如果参数有效,算子 create_deep_ocrcreate_deep_ocrCreateDeepOcrCreateDeepOcrCreateDeepOcrcreate_deep_ocr 返回值 2 (H_MSG_TRUE)。如有必要,则抛出异常。
可能的后继
write_deep_ocrwrite_deep_ocrWriteDeepOcrWriteDeepOcrWriteDeepOcrwrite_deep_ocr,
apply_deep_ocrapply_deep_ocrApplyDeepOcrApplyDeepOcrApplyDeepOcrapply_deep_ocr,
get_deep_ocr_paramget_deep_ocr_paramGetDeepOcrParamGetDeepOcrParamGetDeepOcrParamget_deep_ocr_param,
set_deep_ocr_paramset_deep_ocr_paramSetDeepOcrParamSetDeepOcrParamSetDeepOcrParamset_deep_ocr_param
模块
光学字符识别/光学字符验证