您的位置:首页 > 其它

验证码破解技术四部曲之环境搭建篇(一)

2017-06-20 20:44 274 查看


https://segmentfault.com/a/1190000005821114




前言

转眼就变成大四狗了,大学期间做的比较深入的技术是爬虫,但是爬虫也有很多高级的技术没有涉及,比如说验证码的破解便是其中之一,再加上我对其非常感兴趣,于是乎,开始苦学图像处理、学习机器学习,验证码破解也有了些眉头。

以下是我破解的几种验证码。


1、最容易破解的验证码



直接使用tesseract库识别。


2、download.csdn的验证码



使用K近邻算法识别。


3、weibo.cn验证码



使用卷积神经网络训练识别。


说明

项目源码:https://github.com/nladuo/cap... (可以帮我点个star(^__^)) 

开发语言:python(编写爬虫),c++(编写图像处理部分以及机器学习算法) 

开发环境:ubuntu 14.04 

依赖库: 

Python:PIL、BeautifulSoup4、requests 

C++:boost、opencv2、tesseract-ocr


环境搭建


安装opencv 2.4.12

sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev
wget https://codeload.github.com/Itseez/opencv/zip/2.4.12 unzip opencv-2.4.12.zip
cd opencv-2.4.12 ; mkdir release  ; cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
sudo make install


安装tesseract-ocr

sudo apt-get install tesseract-ocr tesseract-ocr-dev


安装boost

sudo apt-get install libboost-all-dev


安装python的PIL库

sudo apt-get install python-imaging


安装python的BeautifulSoup4、requests库

sudo apt-get install python-pip
sudo pip install bs4
sudo pip install requests


下载项目源码

git clone https://github.com/nladuo/captcha-break.git[/code] 
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: