安装cnocr :pip install cnocr
2021.11.29补:win7电脑32位一直安装不上cnocr,今天试了pip install cnocr==1.2.3
可以安装,但是运行后出现这个问题
使用cnocr:
RuntimeError: Cannot find the MXNet library.
List of candidates:
D:\python\lib\site-packages\mxnet\libmxnet.dll
D:\python\lib\site-packages\mxnet\../../lib/libmxnet.dll
D:\python\lib\site-packages\mxnet\../../build/libmxnet.dll
D:\python\lib\site-packages\mxnet\../../build\libmxnet.dll
D:\python\lib\site-packages\mxnet\../../build\Release\libmxnet.dll
D:\python\lib\site-packages\mxnet\../../windows\Release\libmxnet.dll
>>>
2021.12.12补:原因见文章cnocr避坑指南
from cnocr import CnOcr
ocr = CnOcr()
res = ocr.ocr('cnocrtest4.JPG')
string_list = []
for i in range(len(res)):
for j in res[i]:
string_list.append(j)
ocr_result_string = "".join(string_list)
print("Predicted Chars:", ocr_result_string)
cnocr介绍:https://blog.csdn.net/demm868/article/details/106205308
安装cnstd:pip install cnstd
出问题:根据错误,发现是Polygon3安装失败,查找原因,发现是vs没安装的缘故。安装vs太麻烦了,这路采用安装.whl的方式将Polygon3安装上:pip install Polygon3-3.0.9.1-cp37-cp37m-win_amd64.whl
,再安装cnstd
使用:https://blog.iprac.cn/blogs/127.html
备注:该方法不好用,乱码了