Easy Way to Installing open cv on Linux

Musaddiq Al Ali (Ph.D.)
2 min readAug 10, 2020

--

Open source Computer Vision library or shortly “Open CV” is one of the most popular image processing library. It is massive in functionality yet compact. Here we will install Open CV on Linux. We will introduce debian as linux os to be used, so let us get started:

Install the dependencies

1- From terminal install cmake by typing

sudo apt-get install cmake

2- Install gcc

sudo apt-get install gcc g++

3-Install Open cv dependencies. These dependencies are for GTK support for GUI features, Camera support (v4l), Media Support (ffmpeg, gstreamer), picture format (jpeg, tiff, ..etc)

sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-devsudo apt-get install libavcodec-dev libavformat-dev libswscale-devsudo apt-get install libpng-devsudo apt-get install libpng-devsudo apt-get install libjpeg-devsudo apt-get install libopenexr-devsudo apt-get install libtiff-devsudo apt-get install libwebp-dev

Install git agent and download from github repository

4- install git by simply type the following command in the terminal

sudo apt-get install git

5- Now, just download open cv files by typing:

git clone https://github.com/opencv/opencv.git

Installing open cv

6- change the directory of your work to open cv folder by typing

cd open cv

now in terminal, opencv will be add before the $

6- make directory for building opencv

mkdir build

7- change directory to build

cd build

8- configure open cv files by using cmake command as below

cmake ../

After a while, configuration will finish and the final result should be similar to the following

9-now we need to execute make

make

10- Then execute the installation by typing

sudo make install

Installation process will take long time so, it is recommended to just leave the computer for several hours to finish the process. so, grab a cup of tea and watch your favorite show, or do as I did and enjoy reading a book.

Now you have functioning open cv on your linux. Enjoy working with it and see very soon in another article.

--

--

Musaddiq Al Ali (Ph.D.)
Musaddiq Al Ali (Ph.D.)

Written by Musaddiq Al Ali (Ph.D.)

0 Followers

Specialized in structural optimization and laser physics

No responses yet