-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenCV_3.4_Installation.txt
More file actions
64 lines (43 loc) · 1.99 KB
/
OpenCV_3.4_Installation.txt
File metadata and controls
64 lines (43 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Update and Upgrade
sudo apt-get update
sudo apt-get upgrade
# Install Dependencies
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
#to process images:
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
#to process videos:
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
#For GUI:
sudo apt-get install libgtk-3-dev
#For optimization:
sudo apt-get install libatlas-base-dev gfortran pylint
#To build OpenCV binding for both python 2 and 3.
sudo apt-get install python2.7-dev python3.5-dev
# To Download OpenCV 3.4.0, go to terminal and type:
wget https://github.com/opencv/opencv/archive/3.4.0.zip -O opencv-3.4.0.zip
# To Download OpenCV Contrib 3.4.0 (Contrib has very useful algorithms which is a must for anyone working on Computer Vision), go to terminal and type:
wget https://github.com/opencv/opencv_contrib/archive/3.4.0.zip -O opencv_contrib-3.4.0.zip
# We need to unzip to extract the zip files. Install unzip if not installed using the command:
sudo apt-get install unzip
# Now extract OpenCV and OpenCV Contrib:
unzip opencv-3.4.0.zip
unzip opencv_contrib-3.4.0.zip
# Make a directory named build inside OpenCV-3.4.0:
cd opencv-3.4.0
mkdir build
cd build
# Now we are going to configure cmake:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules -DOPENCV_ENABLE_NONFREE=True ..
# The command will take some time to execute. Wait for few seconds.
# If the configuration is done without error, we will use make command to build.
make -j4 (where 4 is number of cores)
# Install in the location /usr/local using command
sudo make install
# Reinitialize static libs using the following command
sudo ldconfig
# reboot
reboot
# check opencv Version
pkg-config --modversion opencv