[树莓派]树莓派Raspbian系统安装tesseract-ocr实现OCR

第一步安装依赖:启动终端依次敲入命令

sudo apt-get install g++ # or clang++ (presumably)

sudo apt-get install autoconf automake libtool

sudo apt-get install autoconf-archive

sudo apt-get install pkg-config

sudo apt-get install libpng12-dev

sudo apt-get install libjpeg8-dev

sudo apt-get install libtiff5-dev

sudo apt-get install zlib1g-dev

第二步安装Leptonica

sudo apt-get install libleptonica-dev

第三步安装tesseract

sudo apt-get install tesseract-ocr

第四步安装pytesseract

pip install pytesseract

第五步启动python,新建文件夹输入以下代码

#!/usr/bin/env python

from PIL import Image

import pytesseract

text=Image.open('/home/pi/.local/lib/python2.7/site-packages/pytesseract/test.png')

#print(text)

print(pytesseract.image_to_string(text))

第六步保存并运行

相关推荐
orion5710 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户1204872216116 小时前
Linux驱动编译与加载
linux·嵌入式
程序员老赵17 小时前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
vivo互联网技术1 天前
从 10 分钟到 1 秒:ES 深度分页任意跳页的三轮优化实战
服务器·数据库·redis·elasticsearch·深度分页
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房1 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia2 天前
linux curl命令详解_curl详解
linux
扛枪的书生3 天前
Linux 网络管理器用法速查
linux