惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - 马维拉的真实之眼

关于win7添加惠普打印机驱动出现网络打印机驱动安装失败问题的各种解决方法 python 与C#的类方面的区别,纯属感受 word的临时文件机制,还挺有趣 LeetCode,3. 无重复字符的最长子串 LeetCode的一道题引申的python实现的对字符串进行分词,提取词频的方法 python+lego ev3的心得总结 随时更新 坎巴拉太空计划的心得总结 最近学习的sql查询语句连接查询,标记一下 zt <Windows Image Acquisition (WIA)> from msdn zt对于C#中的FileUpload解决文件上传大小限制的问题设置 当不搞技术好几年后,又回来了,忽然很亲切 胡亥语录,也应该学习学习 无意中看到了一个wii Remote的新应用,廉价触摸屏,很实用,而且已经有人在用了,淘宝上已经有卖红外线笔的了 准备入手wii,先在网上乱看了几小时,然后看到了一条新闻,说360和ps3也要做体感,然后就看到了这两张360的体感游戏照片,太牛叉了 这两天要给别人做视频,学习了下友立的会声会影,找到了些好资源 晕,我的nokia 3500c 和 数独游戏 内存惊魂 EA:这不是一个BUG(只有EA这么财大气粗的才能玩这么NB的招数) 谭望嵩和郑智
解决ecplise+phthon2.7中使用pytesser和tesseract进行ocr,出现报错的问题
马维拉的真实之眼 · 2018-02-06 · via 博客园 - 马维拉的真实之眼

网上很多使用ecplise+phthon2.7中使用pytesser或者tesseract进行OCR网站验证码的案例,但配置起来实在让人崩溃。

通用步骤:
1、下载了pytesser_v0.0.1;

2、然后解压后拷贝到C:\ProgramData\Anaconda2\Lib\site-packages;

3、文件夹名字改为pytesser;

4、然后在C:\ProgramData\Anaconda2\Lib\site-packages文件夹下新建一个文件,起名为pytesser.pth,内容为pytesser

5、然后在C:\ProgramData\Anaconda2\Lib\site-packages\pytesser\pytesser.py文件中第六行,更改import Image  为 from PIL import Image;

6、然后在ecplice界面中写代码:

from PIL import Image    
from pytesser import * im = Image.open('C:\\ProgramData\\Anaconda2\\Lib\\site-packages\\pytesser\\phototest.tif')
im.show()

没问题,图片顺利的打开了。

7、然后调用了下oCR的函数:

print image_to_string(im)

然后就无穷无尽的报错。

ecplice的错误提示还毫无帮助,只提示:

Traceback (most recent call last):
  File "C:\Users\TF-2016\Desktop\spider\ruijie\ruijie.py", line 33, in <module>
    print image_file_to_string('11.png', graceful_errors=True)
  File "C:\Python27\lib\site-packages\pytesser\pytesser.py", line 48, in image_file_to_string
    call_tesseract(filename, scratch_text_name_root)
  File "C:\Python27\lib\site-packages\pytesser\pytesser.py", line 23, in call_tesseract
    proc = subprocess.Popen(args)
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] 

网上找了两个小时,很多人遇到这个问题,几乎没有解决的,最后发现有人说起了:http://blog.csdn.net/c465869935/article/details/51438576

然后我决定下载一个最新版的tesseract 3.0.2版,不再依靠pytesseract自带的那个1.01版本了。

下载后安装,然后在pytesseract.py中把tesseract_exe_name = 'tesseract' # Name of executable to be called at command line  改为:

tesseract_exe_name = r'C:/Program Files (x86)/Tesseract-OCR/tesseract.exe' #  'tesseract' Name of executable to be called at command line

然后运行,ok了,可以ocr英文和数字了。

但遗憾的是,中文库是谷歌的网址,下载不下来,如果能下载下来,很期待ocr中文的效果。