镇江网站推广排名,唯品会网站建设,微营销的常见方法有哪些,基于wordpress开发教程一.引言
文字识别#xff0c;也称为光学字符识别#xff08;Optical Character Recognition, OCR#xff09;#xff0c;是一种将不同形式的文档#xff08;如扫描的纸质文档、PDF文件或数字相机拍摄的图片#xff09;中的文字转换成可编辑和可搜索的数据的技术。随着技… 一.引言
文字识别也称为光学字符识别Optical Character Recognition, OCR是一种将不同形式的文档如扫描的纸质文档、PDF文件或数字相机拍摄的图片中的文字转换成可编辑和可搜索的数据的技术。随着技术的发展文字识别技术已经成为信息管理、自动化办公和智能系统的关键组成部分。
二.简介
为了易于集成和使用我们将文字识别OCR封装为DLL动态链接库。这种封装方式不仅保留了算法的性能优势还提供了跨平台和跨语言的兼容性目前支持编程语言如下
CPython易语言
1.C头文件 #ifndef _SN_SDK_H__
#define _SN_SDK_H__#include windows.henum SN_TRACK_MOVE_TYPE
{TRACK_MOVE_TYPE_NORMAL0, // 用于常规轨迹 - 普通游戏鼠标轨迹TRACK_MOVE_TYPE_SLIDER, // 用于滑块轨迹比常规常规轨迹密度更大 - 滑块验证轨迹
};enum SN_TRACK_POINT_TYPE
{TRACK_POINT_TYPE_NORMAL0, // 默认绝对坐标TRACK_POINT_TYPE_RELATIVE, // 相对坐标
};//返回参数
typedef struct SN_RESULT {int code; //错误码如果为 0 表示成功否则表示错误号char message[4096]; //错误信息如果为 OK 表示成功否则返回错误信息}SN_RESULT;//坐标参数
typedef struct SN_POINT
{int x; //屏幕坐标左上角00右下角19201080 - 以实际屏幕为准int y; //屏幕坐标左上角00右下角19201080 - 以实际屏幕为准}SN_POINT;//轨迹参数
typedef struct SN_POINT_PARAMS
{struct SN_POINT point;//屏幕坐标左上角00右下角19201080 - 以实际屏幕为准int delayTime; //延时时间单位毫秒仅供参考}SN_POINT_PARAMS;/*创建句柄
*
* 参数
* [in] szKey 卡密(购买卡密https://shop.4yuns.com/links/7C9F16B7)
* [in] pOnnxFilePath设置 onnx 模型文件路径如果设置为 NULL默认和 DLL文件同级目录
* [out] pResult 返回错误信息参数pResult.code(错误码)如果为 0 表示成功否则表示错误号;
*
* 返回值成功返回句柄失败返回NULL
*
*/
HANDLE WINAPI apiSNCreateHandle(char* szKey, char* pOnnxFilePath, SN_RESULT* pResult);/*设置鼠标移动轨迹默认为 0 表示普通轨迹 ; 1 表示滑块验证时移动轨迹获得的轨迹点数比普通轨迹点数更多
*
* 参数
* [in] handle 句柄通过调用apiSNCreateHandle得到
* [in] density 轨迹密度调节 ,必须大于或者等于 1默认 1
* 例如默认1原本为100个点density 为 5会得到20个点density 为 2会得到50个点
* [in] type 轨迹类型0代表绝对普通轨迹1代表滑块轨迹,具体参考enum SN_TRACK_MOVE_TYPE
*
* 返回值返回参数SN_RESULT.code(错误码)如果为 0 表示成功否则表示错误号;
*
*/
int WINAPI apiSNSetTrackParams(HANDLE handle, int density1, int type0);/*获取鼠标移动轨迹
*
* 参数
* [in] handle 句柄通过调用apiSNCreateHandle得到
* [in] startPoint 开始坐标左上角00右下角19201080 - 以实际屏幕为准
* [in] endPoint 结束坐标左上角00右下角19201080 - 以实际屏幕为准
* [in] type 轨迹坐标类型0代表绝对坐标1代表相对坐标,具体参考enum SN_TRACK_POINT_TYPE
* [out] points 轨迹数组如果数组中元素 point 出现(10000,10000),表示鼠标轨迹结束
*
* 返回值返回参数SN_RESULT.code(错误码)如果为 0 表示成功否则表示错误号;
*
*/
int WINAPI apiSNMouseMove(HANDLE handle, SN_POINT *startPoint, SN_POINT *endPoint, int type, SN_POINT_PARAMS* points);/*获取版本号
*
* 参数
* [in] handle 句柄通过调用apiSNCreateHandle得到
* [out] szVersion 版本号
*
* 返回值返回参数SN_RESULT.code(错误码)如果为 0 表示成功否则表示错误号;
*
*/
int WINAPI apiSNGetVersion(HANDLE handle, char* szVersion);/*获取OCR文字识别卡密到期时间
*
* 参数
* [in] handle 句柄通过调用apiSNCreateOCRHandle得到
* [out] pResult 返回错误信息参数pResult-code(错误码)如果为 0 表示成功否则表示错误号;
*
* 返回值返回卡密到期时间失败返回NULL错误信息请查看参数 pResult-message
*
*/
char* WINAPI apiSNGetKeyExpiresTime(HANDLE handle, SN_RESULT* pResult);/*获取错误信息
*
* 参数
* [in] handle 句柄通过调用apiSNCreateHandle得到
*
* 返回值返回参数SN_RESULT.code(错误码)如果为 0 表示成功否则表示错误号;
*
*/
int WINAPI apiSNGetError(HANDLE handle);/*释放句柄内存
*
* 参数
* [in] handle 句柄通过调用apiSNCreateHandle得到
*
* 返回值返回参数SN_RESULT.code(错误码)如果为 0 表示成功否则表示错误号;
*
*/
int WINAPI apiSNDestroyHandle(HANDLE handle);#endif // !_SN_SDK_H__2.易语言调用dll接口
.版本 2
.支持库 spec.程序集 窗口程序集_启动窗口.子程序 _启动子程序, 整数型_临时子程序 ()
返回 (0).子程序 _临时子程序
.局部变量 handle, 整数型
.局部变量 pResult, SN_STATU, 静态, , 返回错误信息参数pResult.code(错误码)如果为 0 表示成功否则表示错误号;
.局部变量 szOCRJson, 文本型, , , OCR识别结果 json字符串;
.局部变量 szTime, 文本型, , , 卡密结束时间; ---------------------------------------------------------------1.启动 OCR 文字识别服务其中卡密 SNKJe9xffLhdFY7r3TcffXq44ThDVcE3BQFQFfVA9VG4 仅用于测试需要找开发人员重新购买购买卡密连接https://shop.4yuns.com/links/7C9F16B7---------------------------------------------------------------
apiSNInitOCRServer (“SNOCR.onnx”, pResult)
调试输出 (pResult.code, 到文本 (pResult.message))
.如果真 (pResult.code 0)调试输出 (“-----------程序结束-----------”)返回 ().如果真结束2.创建 OCR 文字识别句柄
handle apiSNCreateOCRHandle (“SNKJe9xffLhdFY7r3TcffXq44ThDVcE3BQFQFfVA9VG4”, “SNOCR.onnx”, pResult)
调试输出 (pResult.code, 到文本 (pResult.message))
调试输出 (“句柄”, handle)
.如果真 (pResult.code 0)调试输出 (“-----------程序结束-----------”)返回 ()
.如果真结束3.识别 OCR 文字识别返回 json 字符串
szOCRJson apiSNGetOCRFromImage (handle, “d:\\22.png”, pResult)
调试输出 (到文本 (szOCRJson)) 4.识别 OCR 文字卡密到期时间
szTime apiSNGetKeyExpiresTime (handle, pResult)
调试输出 (到文本 (szTime))5.释放 OCR 文字识别内存
apiSNDestroyOCRHandle (handle)
调试输出 (“-----------程序结束-----------”)
三.效果演示
1.图片1 识别效果 {type: 0,task_id: 1,err_code: 0,ocr_result: {single_result: [{single_rate: 0.939104,left: 102.208336,top: 41.812500,right: 329.854156,bottom: 67.829170,single_str_utf8: 中国建设银行}, {single_rate: 0.966887,left: 104.431534,top: 68.423492,right: 309.992828,bottom: 84.602386,single_str_utf8: China Construction Bank}, {single_rate: 0.968900,left: 102.672920,top: 96.168755,right: 403.258331,bottom: 111.964584,single_str_utf8: 龙卡通(储蓄卡)LONG CARD(DEBIT CARD)}, {single_rate: 0.975151,left: 41.781921,top: 137.955643,right: 410.251556,bottom: 164.107880,single_str_utf8: 6227 0033 2069 0222 205}, {single_rate: 0.935433,left: 20.770407,top: 210.668716,right: 77.230583,bottom: 230.122101,single_str_utf8: ATM}, {single_rate: 0.960131,left: 103.137505,top: 185.368759,right: 192.337509,bottom: 207.204163,single_str_utf8: CCB GZ}, {single_rate: 0.929293,left: 338.376495,top: 201.118103,right: 417.111450,bottom: 224.273529,single_str_utf8: UnionPa}, {single_rate: 0.917808,left: 367.485413,top: 220.677078,right: 413.479156,bottom: 239.260422,single_str_utf8: 银联}],unknown_1: 446,unknown_2: 280}
}
2.图片2 识别效果 {type: 0,task_id: 1,err_code: 0,ocr_result: {single_result: [{single_rate: 0.919637,left: 622.061157,top: 123.251556,right: 1046.638920,bottom: 190.015121,single_str_utf8: 马托13610000670}, {single_rate: 0.996936,left: 40.618664,top: 324.310150,right: 541.513184,bottom: 371.843231,single_str_utf8: 广州利驰服装有限公司}, {single_rate: 0.997014,left: 624.066650,top: 218.300000,right: 1040.933350,bottom: 242.966675,single_str_utf8: 地址:广州市海珠区赤岗路173号}, {single_rate: 0.964238,left: 624.066650,top: 251.600000,right: 844.833374,bottom: 276.266663,single_str_utf8: 金丰大厦503室}, {single_rate: 0.979285,left: 625.300000,top: 286.133331,right: 1044.633300,bottom: 309.566681,single_str_utf8: 厂址:广州市海珠区赤岗西路232}, {single_rate: 0.996300,left: 624.066650,top: 318.200000,right: 759.733337,bottom: 341.633331,single_str_utf8: 号-234号}, {single_rate: 0.991057,left: 624.066650,top: 351.500000,right: 925,bottom: 374.933350,single_str_utf8: 热线:400-688-7260}, {single_rate: 0.964125,left: 625.239319,top: 381.016510,right: 922.600220,bottom: 404.499695,single_str_utf8: 电话:020-84022958}, {single_rate: 0.993601,left: 624.066650,top: 408.233337,right: 923.766663,bottom: 432.900000,single_str_utf8: 传真:020-84022572}, {single_rate: 0.950434,left: 625.203430,top: 438.767609,right: 1107.616580,bottom: 464.666626,single_str_utf8: 邮箱:kunhemwlyahoo.com.cn}, {single_rate: 0.962023,left: 624.066650,top: 471.133331,right: 1001.466670,bottom: 494.566681,single_str_utf8: 网址:www.hxkunhe.com}],unknown_1: 1184,unknown_2: 614}
}
四.常见问题
1.是否支持多线程 支持 五.更新日志
2024.12.15 OCR 文字识别支持C/Python/易语言
六.云盘源码下载
百度云盘夸克云盘123云盘 文章转载自: http://www.morning.cwkcq.cn.gov.cn.cwkcq.cn http://www.morning.mlckd.cn.gov.cn.mlckd.cn http://www.morning.ntwfr.cn.gov.cn.ntwfr.cn http://www.morning.kpgms.cn.gov.cn.kpgms.cn http://www.morning.jkftn.cn.gov.cn.jkftn.cn http://www.morning.xkhhy.cn.gov.cn.xkhhy.cn http://www.morning.bmgdl.cn.gov.cn.bmgdl.cn http://www.morning.rfxg.cn.gov.cn.rfxg.cn http://www.morning.thzgd.cn.gov.cn.thzgd.cn http://www.morning.wlgpz.cn.gov.cn.wlgpz.cn http://www.morning.xrksf.cn.gov.cn.xrksf.cn http://www.morning.tkrdg.cn.gov.cn.tkrdg.cn http://www.morning.tgts.cn.gov.cn.tgts.cn http://www.morning.qqrqb.cn.gov.cn.qqrqb.cn http://www.morning.tblbr.cn.gov.cn.tblbr.cn http://www.morning.npbnc.cn.gov.cn.npbnc.cn http://www.morning.dygqq.cn.gov.cn.dygqq.cn http://www.morning.yhywx.cn.gov.cn.yhywx.cn http://www.morning.xckrj.cn.gov.cn.xckrj.cn http://www.morning.zlgth.cn.gov.cn.zlgth.cn http://www.morning.jltmb.cn.gov.cn.jltmb.cn http://www.morning.dfojgo.cn.gov.cn.dfojgo.cn http://www.morning.thpns.cn.gov.cn.thpns.cn http://www.morning.kzhgy.cn.gov.cn.kzhgy.cn http://www.morning.hymmq.cn.gov.cn.hymmq.cn http://www.morning.xtrzh.cn.gov.cn.xtrzh.cn http://www.morning.ayftwl.cn.gov.cn.ayftwl.cn http://www.morning.zrks.cn.gov.cn.zrks.cn http://www.morning.rgqnt.cn.gov.cn.rgqnt.cn http://www.morning.qqbjt.cn.gov.cn.qqbjt.cn http://www.morning.kxypt.cn.gov.cn.kxypt.cn http://www.morning.fbqr.cn.gov.cn.fbqr.cn http://www.morning.lpmlx.cn.gov.cn.lpmlx.cn http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn http://www.morning.zbqry.cn.gov.cn.zbqry.cn http://www.morning.kgphd.cn.gov.cn.kgphd.cn http://www.morning.lqynj.cn.gov.cn.lqynj.cn http://www.morning.tcsdlbt.cn.gov.cn.tcsdlbt.cn http://www.morning.bnpn.cn.gov.cn.bnpn.cn http://www.morning.cffwm.cn.gov.cn.cffwm.cn http://www.morning.wscfl.cn.gov.cn.wscfl.cn http://www.morning.rzrbw.cn.gov.cn.rzrbw.cn http://www.morning.bftr.cn.gov.cn.bftr.cn http://www.morning.kgqww.cn.gov.cn.kgqww.cn http://www.morning.npmpn.cn.gov.cn.npmpn.cn http://www.morning.bfhrj.cn.gov.cn.bfhrj.cn http://www.morning.wrdlf.cn.gov.cn.wrdlf.cn http://www.morning.nrfrd.cn.gov.cn.nrfrd.cn http://www.morning.cjxqx.cn.gov.cn.cjxqx.cn http://www.morning.nmkfy.cn.gov.cn.nmkfy.cn http://www.morning.zdsqb.cn.gov.cn.zdsqb.cn http://www.morning.hnkkm.cn.gov.cn.hnkkm.cn http://www.morning.nytgk.cn.gov.cn.nytgk.cn http://www.morning.sgfpn.cn.gov.cn.sgfpn.cn http://www.morning.mfct.cn.gov.cn.mfct.cn http://www.morning.tpwrm.cn.gov.cn.tpwrm.cn http://www.morning.jybj.cn.gov.cn.jybj.cn http://www.morning.lbbrw.cn.gov.cn.lbbrw.cn http://www.morning.tnjkg.cn.gov.cn.tnjkg.cn http://www.morning.hknk.cn.gov.cn.hknk.cn http://www.morning.rlbc.cn.gov.cn.rlbc.cn http://www.morning.chxsn.cn.gov.cn.chxsn.cn http://www.morning.wknj.cn.gov.cn.wknj.cn http://www.morning.jzklb.cn.gov.cn.jzklb.cn http://www.morning.zqmdn.cn.gov.cn.zqmdn.cn http://www.morning.txhls.cn.gov.cn.txhls.cn http://www.morning.qgjxt.cn.gov.cn.qgjxt.cn http://www.morning.prysb.cn.gov.cn.prysb.cn http://www.morning.xmnlc.cn.gov.cn.xmnlc.cn http://www.morning.zcrjq.cn.gov.cn.zcrjq.cn http://www.morning.fylqz.cn.gov.cn.fylqz.cn http://www.morning.tmfhx.cn.gov.cn.tmfhx.cn http://www.morning.xqltq.cn.gov.cn.xqltq.cn http://www.morning.sfhjx.cn.gov.cn.sfhjx.cn http://www.morning.cznsq.cn.gov.cn.cznsq.cn http://www.morning.xsszn.cn.gov.cn.xsszn.cn http://www.morning.kzpy.cn.gov.cn.kzpy.cn http://www.morning.cfjyr.cn.gov.cn.cfjyr.cn http://www.morning.routalr.cn.gov.cn.routalr.cn http://www.morning.rhjhy.cn.gov.cn.rhjhy.cn