Linux环境下Python使用tesseract-ocr4.0
https://blog.csdn.net/qq_37781464/article/details/89702993
注意安装报错处理:
https://blog.csdn.net/u014359108/article/details/108343787
下载语言包
https://codechina.csdn.net/mirrors/tesseract-ocr/tessdata?utm_source=csdn_github_accelerator
安装中英文语言包
下载chi_sim.traineddata、eng.traineddata、eng.traineddata.part三个文件,并把它们放到tessdata文件夹中。
cp chi_sim.traineddata /usr/local/share/tessdata
cp eng.traineddata /usr/local/share/tessdata
cp eng.traineddata.part /usr/local/share/tessdata
历史记录,参考:
pip install opencv-python
yum install pip
yum update python
yum -y install epel-release
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install epel-release
yum install python36
pip3 install opencv-python
pip3 install skbuild
pip3 install scikit-build
pip3 install opencv-python
pip3 install cmake
pip3 install opencv-python
yum install -y build-essential
yum install gcc-c++
pip3 install opencv-python -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --upgrade pip
pip3 install opencv-python -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
ls -ltr
pip3 install aircv
python3 adb_python.py
pip3 install matplotlib
ls -ltr
python 555.py
pip3 install opencv-contrib-python
yum install -y libpng-devel libjpeg-devel libtiff-devel
wget http://www.leptonica.org/source/leptonica-1.78.0.tar.gz
tar -xzvf leptonica-1.78.0.tar.gz
cd leptonica-1.78.0
./configure
make
make -j4
make install
echo $?
cd /opt
wget https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/4.0.0
ls
ls -ltr
mv 4.0.0 4.tar.gz
tar zxvf 4.tar.gz
cd tesseract-4.0.0/
ls
./autogen.sh
yum install bail_out
yum install automake -y
yum install libtool -y
./autogen.sh
./configure
pkg-config --version
yum install pkgconfig
vim /etc/profile
source /etc/profile
./configure
make -j3
echo $?
make install
cd tesseract-4.0.0/
ldconfig
tesseract --version
tesseract --list-langs
find / -name tessdata
find . -name tessdata
ls /usr/local/share/tessdata/
ls tessdata/
mv /usr/local/share/tessdata /usr/local/share/tessdata_1
cp -rf tessdata /usr/local/share/
find . -name tessdata
tesseract --list-langs
cd /usr/local/share/
mv tessdata tessdata_111
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
wget https://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
vim /etc/profile
source /etc/profile
ls /usr/local/share/tessdata/eng.traineddata
tesseract bigmap_black_1.jpg 11
二、GitHub开源:支持100多种语言的OCR文字识别
https://github.com/tesseract-ocr/tesseract/blob/master/
DOCKERFILE
https://github.com/tesseract-ocr/tesseract/blob/master/Dockerfile