[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[问题求助] 请求大神 修改用PowerShell调用百度OCR的代码

这几天,放假,就一直研究百度OCR的代码,到今天最后一天了,还是没有搞定,就是修改某大神的VBS代码,原贴在这里
http://www.bathome.net/redirect. ... 8390&pid=219792

后来在百度搜索了看到有人用psl,也可以使用百度的OCR,就照葫芦画瓢,写了一下,但是死活不能运行,有高手能指点一下吗?万分感谢,自己模仿的代码如下:
我使用postman提交下面的相关参数,可以正常识别的,图片的格式是base64的,不包含头,不能有换行,我不知道怎么用函数转,就直接用在线的转码工具转的
附上百度OCR的说明文档:https://cloud.baidu.com/doc/OCR/ ... 2.E8.AF.B4.E6.98.8E
  1. $qaccess_token='24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329'
  2. $language='language_type=CHN_ENG'
  3. $probability='probability=true'
  4. $detect_direction='detect_direction=true'
  5. $image='iVBORw0KGgoAAAANSUhEUgAAAUMAAABACAYAAACA0BUdAAAG9ElEQVR4nO3dvVbqShiH8ZdzLWDh8griFYDNqWx3h6U0dpZ2NlhCZ2tlI1yBXIHLQriX7GRAMhMmk5APmGQ/v7Vy1sINgQmTP5PJm5xeGBEA+Mf9d+4PAAA+IAwBQAh**IQwAQwhAAFMIQAOSsYbiUu15PevFyt6x53Rt5ud6t+/oletQVXWuX1p6D5U6O6xVaf0ovjv61ebnOeP/U0ontDRdGhjiPzYtc9wYyWWU9YS6jKIQK/U4u76LAGkWvyFrVqHqYrSYyaOSHG74gDHEG0ShuMBE9B8eLUOL6/3A9lUD7+3x0LS+uFIuDcKTH4FgW4W5di3Hy5zjM6hjdxcFKIHZS9TBUv8rbQwn6CIpY3umjuG14zYa7h/17+QzXMt0n4komf7JCLApVLQiD6ToKwZn8rkqGs+jxQ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RnQbx1kSZ0G2U/YI06YLo0P72Vr74prvO3//aRZhmEPvAGHhu6n471ztGphDQ+f7GEXOtzfm0YNRkJ0z8b/5kX2s5l6tktLS0aG+nZs4u9vF/YIwPEp8JYN+Syjzqoj2Ol27jJsmOENsKeZlzKkRS/9GbrUd0HUXGeNkQokpmTaODvXtvHr7cIaTfrfvcnOA3dgvag3DttYX/UouWXIVd7fvOlev2pW6G03WKMK456H17jbRDvioFw3/yTg8W8qzVis4dt7RochnPt/o8Kj9S/+xcN7H0bz7j+0Syab7jze5EVa2CKN+EopaxtEjyzPGtr9rrxvbXpVYT4Pd+iXMeervK8Jo2L59TTCNHhWjv0/WZzKec8S669GRdq2nYbDvM4f9ZjHW/831nWvbw/bc9PtY2lVk2xyuy97Pm1F2/1L/YGybYHrQenP7ZXzvzfSfCu1qSA1hmNoQ1qUdYWjbuVxLsc9Spw61K7WjZi2HO3DZttl3rMJhmHqf/M9Vn3L7V9HXFgn4ZvpPlXY1oZbD5P79p6ynLTt2tNre3cR6psywvRqhLRcjeNmu+FKw1P/v5ODTWC/9SivQtugwe135Wteih+X1q7J/xa/N287526eZ/uNdbtQer/rhxMkPI+unH7KdcjTQNN/atf88lftMcsRx+pH7CVTcv5LRWBBW+dpr7z8e5EYv/s95YhgA/EFpDQAIYQgACmEIAEIYAoBCGAKAEIYAoBCGACCEIQAohCEACGEIAAphCABCGAKAQhgCgBCGAKAQhgAghCEAKIQhAAhhCAAKYQgAQhgCgEIYAoAQhgCgEIYAIIQhACiEIQAIYQgACmEIAEIYAoBCGAKAEIYAoBCGACCEIQAofwG4VHXuAIGRUgAAAABJRU5ErkJggg=='
  6. $response = Invoke-RestMethod https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic -Method Post -Body @{
  7. $qaccess_token
  8. $image
  9. $language
  10. $probability
  11. $detect_direction
  12. }
  13. $response
复制代码

查了一些资料,还是不成功,现在代码如下:
  1. $body = @{
  2. "access_token"="24.b305c9822131e65eda05e29c157dd719.2592000.1559103982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Wteih+X1q7J/xa/N287526eZ/uNdbtQer/rhxMkPI+unH7KdcjTQNN/atf88lftMcsRx+pH7CVTcv5LRWBBW+dpr7z8e5EYv/s95YhgA/EFpDQAIYQgACmEIAEIYAoBCGAKAEIYAoBCGACCEIQAohCEACGEIAAphCABCGAKAQhgCgBCGAKAQhgAghCEAKIQhAAhhCAAKYQgAQhgCgEIYAoAQhgCgEIYAIIQhACiEIQAIYQgACmEIAEIYAoBCGAKAEIYAoBCGACCEIQAofwG4VHXuAIGRUgAAAABJRU5ErkJggg=="
  4. "language_type"="CHN_ENG"
  5. "probability"="true"
  6. "detect_direction"="true"
  7. }
  8. $header = @{
  9. "Content-Type"="application/x-www-form-urlencoded"
  10. }
  11. Invoke-RestMethod -Uri "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic" -Method 'Post' -Body $body -Headers $header
复制代码

TOP

直接看官方API文档不好嘛,为啥要研究代码……
代码也没有技术含量啊

TOP

回复 3# 老刘1号

感谢大师回复,我就是想简单的实现百度OCR,但是一查资料看到psl 的代码,更容易懂一些,就想试试,但是一直搞不定,本人纯属小白,稍懂点BAT,

能帮忙试一下吗,我真不懂怎么用API,感谢!

TOP

你这个稍为改了下,提示图片格式不正确。

TOP

回复 5# xczxczxcz

您好,感谢回复,我上面的代码,好像没有问题,是我的ps版本太低的原因,我升级了ps5.0后就OK了,感觉PS比VBS的代码简洁很多

TOP

回复 6# 5i365


    是的,vbs的post需要一个函数封装,ps中只需要一个命令,vbs中也没法直接处理json,我在vbs中是调用js处理的;base64是调用certutil处理的,非常啰嗦

回复 1# 5i365
  1. $bytes = [System.IO.File]::ReadAllBytes("D:\1.jpg");
  2. [System.Convert]::ToBase64String($bytes);
复制代码

TOP

回复 7# 老刘1号

昨晚去百度申请了个KEY;后又申请了一个,把所有能打勾的勾上了。然后就写了个PS。试了下也就几条命令就可以识别了。英文识别还是很准的。但中文几乎都是乱码,搞了很久都没解决。UFT-8,GB2312都是乱码,又用客户端 POSTMAN 操作。能正常显示中文。不知是PS的问题还是其它。用INVOKE-RESTMETHOD 打开网页又不乱码。postman 客户端显示编码是 gzip 。晕。

TOP

回复 7# 老刘1号

感谢大师回复,搞来搞去,我又搞回VBS了,因为win7自带的PS2.0无法运行上面的代码,还要安装升级包才可以用,实在是晕

我用谷歌,在国外,找到了最简单的VBS的百度OCR代码,但是又卡壳了,无法识别中文部分,显示的是乱码,代码如下:

Wscript.Echo r.ResponseBody  用这个输出全是乱码,但是搜索资料说,这个输出才是unicode
Wscript.Echo r.ResponseText  用这个输出英文部分正常,中文部分是乱码,

真心希望各路高手给支招一下,我走的道路太曲折了,提前感谢
  1. Set r = CreateObject("WinHttp.WinHttpRequest.5.1")
  2. r.Open "POST", "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic"
  3. r.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  4. r.Send "access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image=iVBORw0KGgoAAAANSUhEUgAAAScAAACCCAYAAAAE%2FA6oAAAK40lEQVR4nO3dQU%2FbyBvH8Ser%2F0uA8gbISmHpGwhiK3EjvVRVleve0ko9wGVvK7VIvXEJB7Qlt71G24rLhhtSi%2BAN0CXSJm%2BAwnvIf2bsUEjsxE4m8ePw%2FUhICBzbie1fZsYznkLPEABQ5qesdwAAohBOAFQinACoRDgBUIlwAqAS4QRAJcIJgEqEEwCVCCcAKhFOAFQinACoRDgBUIlwAqAS4QRAJcIJgEqEEwCVCCcAKhFOAFQinACoRDgBUIlwAqAS4QRAJcIJgEqEEwCVCCcAKhFOAFQinACoRDgBUIlwAqAS4QRAJcIJgEqEEwCVCCcAKhFOs3bblW7W%2BwDkkL9wuj2Qjb2CvG6nWX5DDm697UGoKwcfU%2ByHcfK5IIWPBzMKkX%2FkN%2FO5FNJ8NlM7kddz3R7gX6FneFubDZzDXbmQmrTeHcn2uOXbr6XQbJhfEi6fkA2byuUEL3zakt5LX3sR6n8ms1i3xu0Cnvit1i3tyB9P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dFoP8o80JysU0UCd5BA9yjXACoBLVOgAqEU4AVCKcAKhEOAFQiXACoBLhBEAlwgmASoQTAJUIJwAqEU4AVCKcAKhEOAFQiXACoBLhBEAlwgmASoQTAJUIJwAqEU4AVCKcAKhEOAFQiXACoBLhBEAlwgmASoQTAJUIJwAqEU4AVCKcAKhEOAFQiXACoBLhBEAlwgmASoQTAJUIJwAqEU4AVCKcAKj0f0KuyhM4KAWmAAAAAElFTkSuQmCC&language_type=CHN_ENG&probability=true&detect_direction=true"
  5. 'Wscript.Echo r.ResponseBody
  6. Wscript.Echo r.ResponseText
复制代码

TOP

回复 7# 老刘1号

另外,本人也正在使用天若的OCR软件,我发现默认的是搜狗的OCR引擎,在识别的速度和精度上,比百度还要更上一层,我是经过多次测试才发现的,大师能再开一贴,把搜狗的OCR也搞一下吗?感谢!
本人搞这些,纯属兴趣,就是想搞成一键双击后识别某个路径的图片文件,平时用的还是天若多一些
   

TOP

本帖最后由 5i365 于 2019-5-7 11:32 编辑

回复 8# xczxczxcz

朋友,咱俩同病相怜,我也是这个情况,PS和VBS都这样,建议win10就用PS,如果是win7还是VBS好一些,代码也短多了

TOP

回复 11# 5i365


    楼顶的的很多是多余的,图片位置|image|body|headers|invoke|获取结果。共6句即可。image可用命令获取并赋值。token部分可用iwr获取返回值。

TOP

偶放弃用这个了,直接用百度接口。立马识别中文。简单得不得了。

TOP

pwowershell 直接用百度OCR 接口。需下载百度 C# 的SDK(可集成到系统里)。PS中调用。
1

评分人数

TOP

回复 14# xczxczxcz

你好,刚看到回复,能发一下你用接口在PS中调用百度的代码吗,我对调用接口基本不懂,这正好是个学习的机会,万分感谢!

TOP

返回列表