-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstalling_OpenCV
More file actions
90 lines (60 loc) · 2.56 KB
/
Copy pathinstalling_OpenCV
File metadata and controls
90 lines (60 loc) · 2.56 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Install all the dependencies:
sudo aptitude update
sudo aptitude dist-upgrade
sudo aptitude purge libopencv-dev python-opencv
sudo aptitude install build-essential cmake git
sudo aptitude install qt5-default libvtk6-dev libgtk2.0-dev gnome-themes-standard
sudo aptitude install zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev
sudo aptitude install libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev
sudo aptitude install libtbb-dev libeigen3-dev
sudo aptitude install python-dev python-tk python-numpy python3-dev python3-tk python3-numpy python-sphinx python3-sphinx
sudo aptitude install ant default-jdk
sudo aptitude install doxygen
Add this line to /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/ yakkety universe
Install libjasper-dev:
sudo aptitude update
sudo aptitude install libjasper-dev
Comment the line from /etc/apt/sources.list and update:
sudo aptitude update
Download the latest OpenCV from github:
cd ~/admin
mkdir opencv
cd opencv
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.3.0
cd ..
Dowload the contribution modules and the extas:
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib
git checkout 3.3.0
cd ..
git clone https://github.com/Itseez/opencv_extra.git
cd opencv_extra
git checkout 3.3.0
cd ..
Remove the hdf module (at the moment creates problems to compile):
rm -r opencv_contrib/modules/hdf
Create the build directory and build OpenCV:
cd opencv
mkdir build
cd build
cmake -D ENABLE_PRECOMPILED_HEADERS=OFF -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=~/admin/opencv/opencv_contrib/modules/ -D BUILD_EXAMPLES=ON -D BUILD_DOCS=ON -D WITH_TBB=ON -D WITH_EIGEN=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
After a successful compilation, install it in the system:
sudo make install
sudo ldconfig
Check some of the examples to be sure that everything went fine:
export OPENCV_TEST_DATA_PATH=~/admin/opencv/opencv_extra/testdata
cd bin
./opencv_test_core
Build the documentation:
cd ..
make doxygen
make doc
Useful links:
http://milq.github.io/install-opencv-ubuntu-debian/
http://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html#gsc.tab=0
http://docs.opencv.org/master/dd/dd5/tutorial_py_setup_in_fedora.html
https://stackoverflow.com/questions/43484357/opencv-in-ubuntu-17-04