This was tested with Ubuntu 16.04
Make sure we are in our home directory
1 | cd ~ |
Upgrade any currently installed packages (may take a long time)
1 2 | sudo apt-get update sudo apt-get upgrade |
1 2 3 4 | sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy sudo apt-get install -y unzip wget |
1 | sudo apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev |
1 | sudo apt-get install libgtk2.0-dev |
1 | sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev |
1 | sudo apt-get install libatlas-base-dev gfortran |
1 2 | wget https: //bootstrap .pypa.io /get-pip .py sudo -H python get-pip.py |
1 | sudo -H apt-get install python2.7-dev |
Numpy is used by Python for Image representation.
1 | sudo pip install numpy |
Get OpenCV 3.3 build from GitHub
1 2 3 4 5 | cd ~ wget https: //github .com /opencv/opencv/archive/3 .3.0.zip unzip 3.3.0.zip mv opencv-3.3.0/ opencv cd opencv |
1 2 3 4 | cd ~ /opencv $ mkdir build $ cd build $ sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX= /usr/local .. |
1 | make -j7 |
If you run out of disk space on your VM check out the little guide on extending your Virtual Disk
https://avinton.com/en/academy/extending-virtualbox-virtual-drive/
1 2 | sudo make install sudo ldconfig |
1 | python |
1 2 | import cv2 cv2.__version__ |
The above should return 3.3.0 (The OpenCV Version you installed)
Exit python interpreter and return to terminal
1 | exit() |