sudo apt-get -y install libopencv-dev build-essential cmake libdc1394-22 libdc1394-22-dev libjpeg-dev libpngl2-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v41-utils
$ wget "https://github.com/opencv/opencv/archive/4.0.0.tar.gz" -0 opencv.tar.gz $ wget "https://github.com/opencv/opencv_contrib/archive/4.0.0.tar.gz" -0 opencv_contrib.tar.gz $ tar -zxvf opencv.tar.gz $ tar -zxvf opencv contrib.tar.gz $ cd opencv-4.0.0 $ mkdir build $ cd build $ cmake -D CMAKE BUILD TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/full/path/to/opencv-4.0.0/build -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D OPENCV EXTRA_MODULES PATH=/full/path/to/opencv_contrib-4.0.0/modules . $ make -j4 $ sudo make install ./