How to install OpenCV on Linux: Step-by-Step guide - STEPS are in DESCRIPTION

preview_player
Показать описание
In this tutorial video, we will guide you through the process of installing OpenCV on a Linux system. OpenCV is an open-source computer vision library that is widely used for image processing, video analysis, and machine learning applications. Installing OpenCV on Linux can be a complex task, but with our step-by-step guide, you'll be able to easily install OpenCV on your Linux machine. We'll cover everything from downloading and installing the necessary dependencies to configuring and building OpenCV from source. Whether you're a beginner or an experienced Linux user, this video will help you get started with OpenCV on Linux.

STEPS1 Installing the dependencies:

1 - sudo apt install build-essential cmake git pkg-config libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev python3-dev python3-numpy libtbb2 libtbb-dev libdc1394-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev

STEP2 Downloading the source code:

2 - cd && mkdir workspace && cd workspace

3 - mkdir ./opencv_build && cd ./opencv_build

6 - cd ~/workspace/opencv_build/opencv && mkdir -p build && cd build

7 - cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_QT=ON -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=~/workspace/opencv_build/opencv_contrib/modules -D BUILD_EXAMPLES=ON ..

STEP3 Compiling and installing OpenCV:

8 - make -j8

9 - sudo make install

10 - pkg-config --modversion opencv4

STEP4 Setting the system to find the library:

12 - sudo ldconfig

13 - echo ’PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig’ | sudo tee --append ~/.bashrc

14 - echo ’export PKG_CONFIG_PATH’ | sudo tee --append ~/.bashrc
15 - source ~/.bashrc

Please join in My Telegram channel:

Рекомендации по теме
Комментарии
Автор

This video is very helpfull! I got an error tho, STEP 2 code 7.

-- Configuring incomplete, errors occurred!


I spoted some fails during execution, here they are all together:

-- Performing Test - Failed
-- Looking for _aligned_malloc - not found
-- Looking for sgemm_ - not found
-- Looking for cheev_ - not found
-- Performing Test - Failed
-- Performing Test - Failed
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed
-- Performing Test - Failed
-- Performing Test - Failed
-- Performing Test - Failed
-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
-- Looking for dlerror in dl - found
-- No package 'gtk+-2.0' found
-- Performing Test - Failed

I don't know which ones are irrelevant.
Do you have any idea of what went wrong?

When I type "git branches -a" it shows:

remotes/origin/2.4
remotes/origin/3.4
remotes/origin/4.x
remotes/origin/5.x
remotes/origin/HEAD -> origin/4.x
remotes/origin/master
remotes/origin/next


I don't know if it is fine.

Thanks in advance!

JorgeFerreira-qt