所有的安装包都已经上传到csdn里可以自行下载
https://download.csdn.net/download/qq_16590151/12810990
运行中存在异常百度记可
window无需安装,直接将jar包引入即可
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>opencv</groupId>
<artifactId>opencv</artifactId>
<version>4.4.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/opencv-440.jar</systemPath>
</dependency>
安装openssl
yum install openssl-devel
cmake安装
mkdir app
cd app
wget https://cmake.org/files/v3.18.1/cmake-3.18.1.tar.gz
tar xzvf cmake-3.3.2.tar.gz
yum install gcc-c++
cd cmake-3.18.1
./bootstrap
gmake
make install
cmake --version
opnecv安装
mkdir -p /usr/local/opencv_make
cd /usr/local/opencv_make
mkdir release
wget https://github.com/opencv/opencv/archive/4.4.0.tar.gz
tar -zvxf opencv-4.4.0
cd opencv-4.4.0
mkdir build
cd build
yum -y install gcc gcc-c++ gtk±devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm build-essential ant
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv_make/release -DBUILD_TESTS=OFF ..
make -j8 & make
cd /usr/local/opencv_make/opencv-4.4.0/build/lib
cp libopencv_java440.so /usr/lib64/
tess4j安装
tar -zxvf leptonica-1.79.0.tar.gz
tar -zxvf tesseract-4.1.1.tar.gz
cd leptonica-1.79.0
./configure && make && make install
vim /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
source /etc/profile
cd tesseract-4.1.1
./autogen.sh
./configure && make && make install
cd /usr/local/lib
cp liblept.so /usr/lib64/
cp libtesseract.so /usr/lib64/