Can Linux use opencv?

WBOY
Release: 2022-07-26 17:07:28
Original
2949 people have browsed it

Opencv can be used in Linux; opencv is a cross-platform computer vision and machine learning software library released based on BSD license open source. It can run on Linux, Windows, Android and macOS operating systems, and consists of a series of C functions It is composed of a small number of "C" classes, and provides interfaces for Python, Ruby, MATLAB and other languages, and implements many general algorithms in image processing and computer vision.

Can Linux use opencv?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Can Linux use opencv?

OpenCV is a cross-platform computer vision and machine learning software library released based on BSD license (open source), which can run on Linux, Windows, Android and Mac OS on the system. It is lightweight and efficient - it consists of a series of C functions and a small number of C classes. It also provides interfaces in Python, Ruby, MATLAB and other languages, implements many common algorithms in image processing and computer vision, and uses them when available. MMX and SSE instructions now also provide support for C#, Ch, Ruby, and GO.

Download OpenCV

Download in the virtual machine. The download URL is Releases - OpenCV. Since it is Linux, download the source version

Can Linux use opencv?

After downloading, copy the file to the home directory or create a new folder in the home to store it, enter the command line to decompress, the decompression command is

unzip opencv-3.4.15.zip
Copy after login

Here you enter according to your own version Different number, mine is 3.4.15. After decompression, it is as follows

Can Linux use opencv?

Then configure the environment and download the dependent libraries and cmake required by opencv, because the configuration file obtained after downloading cannot To use it directly, you need to use cmake to compile

Download through the command

sudo apt-get install cmake 
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff5.dev libswscale-dev libjasper-dev
Copy after login

and then enter the file, then create a my_build_dir file in the file, and enter

mkdir my_build_dir
cd my_build_dir
Copy after login

and then cmake Start building and generating some configuration files

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
Copy after login

The next step is the compilation process. Use sudo make

sudo make
Copy after login

After completion, execute sudo make install. This command is used for installation.

sudo make install
Copy after login

The next step is to configure the environment variables. The configuration process is a little more complicated than under Windows system. First add the path through gedit and open the file, and add /usr/local/lib at the end of the file

sudo gedit /etc/ld.so.conf.d/opencv.conf
Copy after login

After saving, switch to the command line interface and execute the command to make the configuration path take effect

sudo ldconfig
Copy after login

Configuring bash

sudo gedit /etc/bash.bashrc
Copy after login

Recommended learning: Linux video tutorial

The above is the detailed content of Can Linux use opencv?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template