一:post 搜狗 的方法
优点:准确率高
缺点:每次识别都要上传图片,占用网络,速度一般
post(r’http://ocr.shouji.sogou.com/v2/ocr/json’, files=im_files)
from requests import post
def cs():
filename = 'temp.png'
multiple_files = {
'pic': ('1111111.jpg', open(filename, 'rb'), 'image/jpg')}
resp = post(r'http://ocr.shouji.sogou.com/v2/ocr/json', files=multiple_files)
str_json