从字库中识别文字 - OcrFromDictPtr
函数简介
从字库中识别文字。需提前加载数据库,参考接口SetConfig
支持多个字库同时识别适配字体变形等场景,多个字库用|分割 。如dict1|dict2
接口名称
OcrFromDictPtr
DLL调用
long OcrFromDictPtr(long instance, long ptr, string colorJson, string dict_name, double matchVal)
参数说明
参数名 | 类型 | 说明 |
---|---|---|
instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
ptr | 长整数型 | 图像指针 |
colorJson | 字符串 | 颜色列表的JSON字符串,格式如:[{"StartColor": "3278FA", "EndColor": "6496FF", "Type": 0}, {"StartColor": "3278FA", "EndColor": "6496FF", "Type": 1}] |
dict_name | 字符串 | 字库名称 |
matchVal | 双精度浮点数 | 匹配值 |
示例
// 示例代码待补充
返回值
识别到的文字(二进制字符串的指针)
注意事项
- 返回的字符串指针需调用FreeStringPtr释放内存