HowTos Linux

How to install OpenCV 3.2 on Ubuntu 16.04, Linux Mint

OpenCV 3.2 released comes with tons of improvements and bug fixes. Its is an open source computer vision and machine learning software library, built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Before we look at how to install OpenCV on Ubuntu, let’s review changes in latest release:

install opencv

v3.2 Changelog

  • sinusoidal patterns for structured light and phase unwrapping module
  • DIS optical flow (excellent dense optical flow algorithm that is both significantly better and significantly faster than Farneback’s algorithm – our baseline), and learning-based color constancy algorithms implementation
  • CNN based tracking algorithm (GOTURN)
  • PCAFlow as well as Global Patch Collider algorithms implementation
  • Multi-language Tutorials in Python, C++ and Java
  • New camera model as well as parallel processing for stitching pipeline
  • Optimizations as well as improvements of dnn module
  • Base64 and JSON support for file storage. Use names like “myfilestorage.xml?base64” when writing file storage to store big chunks of numerical data in base64-encoded form.
  • tiny_dnn improvements and integration
  • Quantization and semantic saliency detection with tiny_dnn
  • Word-spotting CNN based algorithm

Other Improvements

  • Greatly improved and accelerated dnn module in opencv_contrib:
    • Many new layers, including deconvolution, LSTM etc.
    • Support for semantic segmentation and SSD networks with samples.
    • TensorFlow importer + sample that runs Inception net by Google.
  • More image formats and camera backends supported
  • Interactive camera calibration app
  • Multiple algorithms implemented in opencv_contrib
  • Supported latest OSes, including Ubuntu 16.04 LTS as well as OSX 10.12
  • Lot’s of optimizations for IA and ARM archs using parallelism, vector instructions and new OpenCL kernels.
  • Can now use vendor-provided OpenVX and LAPACK/BLAS (including Intel MKL, Apple’s Accelerate, OpenBLAS and Atlas) hence improving acceleration
READ  Install latest Dolphin Emulator for Gamecube & Wii on Linux

How to install Opencv 3.2 on Ubuntu 16.04

Note: This would take sometime to complete, so be patient.

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

mkdir opencv

cd opencv

wget https://github.com/Itseez/opencv/archive/3.2.0.zip -O opencv-3.2.0.zip

unzip opencv-3.2.0.zip

cd opencv-3.2.0

mkdir build

cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

make -j $(nproc)

sudo make install

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'

sudo ldconfig
  • Reboot your machine and run following command to check installed version
pkg-config --modversion opencv

How to uninstall it from Ubuntu 16.04

sudo apt-get remove opencv

About the author

Admin

A passionate Linux and Open Source user. In my spare time, I love developing mobile games for fun (You can check my games out iOS Store | Google Play Store) and also spend time contributing to the Linux community.

Leave a Reply

3 Comments on "How to install OpenCV 3.2 on Ubuntu 16.04, Linux Mint"

Notify of
avatar
Sort by:   newest | oldest | most voted
Alex
Guest
Alex

Thanks for these instruction! However, how can I adjust these command to install this inside a conda environment and create bindings to the python version from the conda environment?

Admin
Guest

Hi and thanks for comment. Haven’t played around with conda so hopefully someone might have and would share more insight on it.

You can ask this on the github page “https://github.com/opencv/opencv” for faster response

Karthick
Guest
Karthick

Will this support ffmpeg. If I would like to have ffmpeg support, what should I modify in your instructions. Planning to install it on a python 3.6 virtual environment (linux mint 18.1).

wpDiscuz