selenium python 图像二值化
2017-10-24 09:41
141 查看
1. 使用PIL
# coding:utf-8 # coding:cp936 # 二值化处理 from selenium import webdriver from PIL import Image from time import sleep # broswer = webdriver.Chrome() im = Image.open(r'C:\picture6.png') imgry = im.convert('L') # imgry.show() threshold = 200 table = [] for i in range(256): if i < threshold: table.append(1) else: table.append(0) out = imgry.point(table, '1') out.save(r'C:\ocr1.png')
参考:
Python验证码识别:利用pytesser识别简单图形验证码
相关文章推荐
- selenium+python笔记1
- 使用Python+Selenium过程中中常见的问题汇总
- 【selenium+python】自动化测试目录与文件结构
- selenium+python实现bilibili视频播放测试
- python + selenium的显示等待、键盘操作事件、鼠标操作事件
- Selenium2+python自动化-元素定位参数化(find_element)
- Python selenium —— 父子、兄弟、相邻节点定位方式详解
- 【Python】抓取京东列表页商品信息(selenium)
- python+selenium:不会定位元素----使用firepath工具
- python+selenium启动firefox和chrome
- python3 selenium 获取JS动态页面title
- [python爬虫] Selenium爬取内容并存储至MySQL数据库
- 关于selenium 用Webdrive打开Firefox不含有插件的问题(python)
- Web Scraping with Python:使用 Selenium 给当前网页截屏
- 解决python selenium3启动不了firefox的问题
- A Selenium and Python appetizer
- Behave + Selenium(Python) ------ (第二篇)
- selenium+python3.6学习——环境
- Python爬虫Selenium安装