Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of compiling, installing and configuring opencv-2.4.13+tesseract-3.04 under ubuntu-16.04

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the method of compiling, installing and configuring opencv-2.4.13+tesseract-3.04 under ubuntu-16.04". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "the method of compiling, installing and configuring opencv-2.4.13+tesseract-3.04 under ubuntu-16.04".

Recently, we are working on an automatic recognition project, the principle is to use java to call the native libraries of opencv and tesseract through jni to achieve image recognition and digital recognition. The following is the configuration of the linux runtime environment.

1. Install opencv1.1 preparation environment # install compilation tools sudo apt-get install build-essential # install dependency package sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev# install optional package sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev1.2 download and compile the program

Https://github.com/opencv/opencv/archive/2.4.13.5.tar.gz

Tar xvf 2.4.13.5.tar.gzcd opencv-2.4.13.5 mkdir release / / create a new folder to store the temporary file cd release sudo cmake-D CMAKE_BUILD_TYPE=RELEASE-D CMAKE_INSTALL_PREFIX=/usr/local.. Sudo make / / start compiling (about 15 minutes) sudo make install

Note: you may be prompted at this time:

Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY

The reason is that the incorrect installation of jdk or jdk cannot be found, just execute the following command:

Sudo apt-get install-y openjdk-8-jdksudo apt-get install-y default-jdkexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

When executing cmake, if you prompt that the JNI of Java is not NO, it means that the environment configuration of java is valid.

1.3.Configuring the library load path sudo vim / etc/ld.so.conf.d/opencv.conf

Join / usr/local/lib, then execute

Sudo ldconfig

After installation, you can see the installed libraries and jar packages under / usr/local/share/OpenCV/java. In addition, export the package configuration path

Sudo vim / etc/bash.bashrc

Join

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfigexport PKG_CONFIG_PATH

Last

Source / etc/bash.bashrc2. Install tesseract2.1. Install the corresponding libsudo apt-get install libpng12-devsudo apt-get install libjpeg62-devsudo apt-get install libtiff5-devsudo apt-get install libtoolsudo apt-get install gccsudo apt-get install g++sudo apt-get install automake2.2. Download and install leptonicawget http://www.leptonica.org/source/leptonica-1.73.tar.gztar zxvf leptonica-1.73.tar.gzcd leptonica-1.73./configuremakemake install2.3. Download and install tesseractwget https://github.com/tesseract-ocr/tesseract/archive/3.04.01.tar.gztar zvf 3.04.01.tar.gzcd tesseract-3.04.01sudo. / autogen.sh./configuremakemake installldconfig3. Reference website

Https://blog.csdn.net/cheneykl/article/details/79115131 https://blog.csdn.net/pangyunsheng/article/details/79372845 https://stackoverflow.com/questions/51047978/cmake-could-not-find-jni

At this point, I believe you have a deeper understanding of "the method of compiling, installing and configuring opencv-2.4.13+tesseract-3.04 under ubuntu-16.04". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report