当前位置:网站首页>Python image recognition OCR
Python image recognition OCR
2020-11-07 20:56:00 【Coxhuang】
List of articles
- Python Image recognition OCR
- #1 demand
- #2 Environmental Science
- #3 install
- #3.1 macOS
- #3.2 Linux(CentOS)
- #4 Use
- #4.1 python install pytesseract library
- #4.2 Python Code
- #5 Online case
Python Image recognition OCR
#1 demand
- Identify the information in the picture , Such as QR code
#2 Environmental Science
macOS / Linux Python3.7.6
#3 install
#3.1 macOS
- install tesseract
// Install only tesseract, Don't install training tools brew install tesseract // install tesseract At the same time install training tools brew install --with-training-tools tesseract // install tesseract Install all languages at the same time , The language pack is bigger , If installed, it will take a long time , It is not recommended to install , Select on demand brew install --all-languages tesseract // install tesseract, And install training tools and language brew install --all-languages --with-training-tools tesseract
2. Download the language pack
Address : https://github.com/tesseract-ocr/tessdata
I have installed a Chinese language pack here
Chinese language pack : https://github.com/tesseract-ocr/tessdata/blob/master/chi_sim.traineddata
Then copy the downloaded Chinese language pack to the following path :
/usr/local/Cellar/tesseract/4.0.0_1/share/tessdata
3. Check out the local language pack
tesseract --list-langs
#3.2 Linux(CentOS)
- Installation dependency
yum install autoconf automake libtool libjpeg-devel libpng-devel libtiff-devel zlib-devel
2. install leptonica
download : wget https://github.com/tesseract-ocr/tesseract/archive/4.1.0.tar.gz
Unpack the installation
tar -xzvf leptonica-1.74.4.tar.gz cd leptonica-1.74.4.tar.gz ./configure --profix=/usr/local/leptonica make sudo make install
3. install tesseract-ocr
wget https://github.com/tesseract-ocr/tesseract/archive/3.04.zip unzip 3.04.zip cd tesseract-3.04/ ./configure make && make install sudo ldconfig
I have installed a Chinese language pack here
Chinese language pack : https://github.com/tesseract-ocr/tessdata/blob/master/chi_sim.traineddata
Then copy the downloaded Chinese language pack to the following path :
/usr/local/share/tessdata
#4 Use
#4.1 python install pytesseract library
pip install pytesseract pip install Pillow
#4.2 Python Code
from PIL import Image import pytesseract # Specify the image path and identify the language data = pytesseract.image_to_string(Image.open('/Users/Documents/1.png'), lang='chi_sim') print(data)
#5 Online case
Address :
Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .
版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢
边栏推荐
- Deep into web workers (1)
- Kubernetes服务类型浅析:从概念到实践
- 模型预测准确率高达94%!利用机器学习完美解决2000亿美元库存难题
- A detailed explanation of microservice architecture
- Design pattern of facade and mediator
- 【解决方案】分布式定时任务解决方案
- 团灭 LeetCode 股票买卖问题
- Using pipe() to improve code readability in pandas
- 一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
- delphi10的rest.json与system.json的踩坑
猜你喜欢
14000 word distributed transaction principle analysis, master all of them, are you afraid of being asked in the interview?
某618大促项目的复盘总结
微信小程序request报400错误 @RequestBody接收不到
【解决方案】分布式定时任务解决方案
Using pipe() to improve code readability in pandas
深入web workers (上)
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
阿里terway源码分析
Deep into web workers (1)
在pandas中使用pipe()提升代码可读性
随机推荐
屏读时代,我们患上了注意力缺失候群症
虚拟DOM中给同一层级的元素设置固定且唯一的key为什么能提高性能
在 Amazon SageMaker 管道模式下使用 Horovod 实现多 GPU 分布式训练
14000 word distributed transaction principle analysis, master all of them, are you afraid of being asked in the interview?
Recommend suicide, openai warns: gpt-3 is too risky for medical purposes
深入web workers (上)
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
模型预测准确率高达94%!利用机器学习完美解决2000亿美元库存难题
Design pattern of facade and mediator
Analysis of kubernetes service types: from concept to practice
Kylin on kubernetes' practice on eBay
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
某618大促项目的复盘总结
是时候结束 BERTology了
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
来自不同行业领域的50多个对象检测数据集
Three steps, one pit, five steps and one thunder, how to lead the technical team under the rapid growth?
编程界大佬教你:一行Python代码能做出哪些神奇的事情?
ROS学习---远程启动ROS节点
Exploration and practice of growingio responsive programming