python验证码识别
来源:互联网 发布:淘宝网店铺装修宝典 编辑:程序博客网 时间:2024/05/16 16:12
waitalone大牛的博客:
http://www.waitalone.cn/python-php-ocr.html
这次验证码识别,我使用的python来实现的,发现python果然是强大无比,但是在验证码识别库的安装上面有点小问题。
关于python验证码识别库,网上主要介绍的为pytesser及pytesseract,其实pytesser的安装有一点点麻烦,所以这里我不考虑,直接使用后一种库。
python验证码识别库安装
要安装pytesseract库,必须先安装其依赖的PIL及tesseract-ocr,其中PIL为图像处理库,而后面的tesseract-ocr则为google的ocr识别引擎。
1、PIL 下载地址:
PIL-1.1.7.win-amd64-py2.7.exe
PIL-1.1.7.win32-py2.7.exe
或者直接使用pillow来代替,使用方法基本没有什么区别。
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow
2、tesseract-ocr下载地址:
tesseract-ocr-setup-3.02.02.exe
3、pytesseract安装
直接使用pip install pytesseract安装即可,或者使用easy_install pytesseract
python验证码识别方法
#!/usr/bin/env python # -*- coding: gbk -*- # -*- coding: utf_8 -*- # Date: 2014/11/27 # Created by 独自等待 # 博客 http://www.waitalone.cn/ try: import pytesseract from PIL import Image except ImportError: print '模块导入错误,请使用pip安装,pytesseract依赖以下库:' print 'http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil' print 'http://code.google.com/p/tesseract-ocr/' raise SystemExit image = Image.open('vcode.png') vcode = pytesseract.image_to_string(image) print vcode
识别率还挺高的,当然这也和验证码本身有关,因为这个验证码设计的比较容易识别。
验证码识别成功
python识别验证码,就是这么简单,大家还不快来试一试?
php验证码识别方法
关于php的验证码识别,这个我没有深入研究,但是用python实现完了以后就明白了,其实只要借助ocr识别库就可以了,直接贴上之前脚本关第9关的代码。
python实现的验证码识别破解实例请关注:
http://www.waitalone.cn/security-scripts-game.html
view source
01
- python 识别验证码
- python 验证码识别
- python验证码识别
- python验证码识别
- 《python识别验证码》
- python 验证码识别
- python 识别验证码
- Python验证码识别
- Python 验证码识别
- python 识别验证码
- python验证码识别
- python 验证码识别
- python 验证码识别
- Python 识别验证码
- python识别验证码
- [python]python验证码识别
- Python验证码识别模块
- python怎样识别验证码
- 网易游戏技术公开日分享
- Sqoop处理Clob与Blob字段
- Server.Transfer 页面传值.
- C#课程设计
- Linux下安装redis
- python验证码识别
- 代码块(Block)
- C#索引器
- 同一个TextView中设置不同颜色与文字大小
- Bluemix云平台实践: ASP.NET5开发实例
- springMVC+hibernate+maven整合
- 分班考试
- 11个超棒的iOS开发学习网站
- 如何向android studio中导入第三方类库