Install OpenCV 2.4.8 on Ubuntu 13.10

Following are the instructions to install OpenCV on Ubuntu machine. I am using latest version of OpenCV 2.4.8 and latest version of Ubuntu 13.10. For old versions (2.3 and earlier) of OpenCV you can follow my earlier blog post here. Installing new version of OpenCV is slightly different hence I am presenting this post.

Following steps will guide you to install OpenCV 2.4.8 on Ubuntu 13.10

1. First we will install essential tools for buidling OpenCV. Use following command in your terminal to install them.

sudo apt-get install build-essential cmake pkg-config

2. Following command will install required Image I/O libraries.

sudo apt-get install libjpeg62-dev libtiff4-dev libjasper-dev

3. Install gtk libraries for highgui

sudo apt-get install  libgtk2.0-dev

4. Install required video libraries.

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev

5. Download OpenCV from sourceforge using below link and extract zipped file. Enter into zipped directly.

6. Create a build directory in zipped file and enter into it using following terminal command.

mkdir build
cd build

7. Type following command in terminal window to start building process.


8.  Compile the source code using following command.


9.  Install OpenCV using following command.

sudo make install

Now your machine is ready to rock with OpenCV. 


  1. very helpful, thanks.

    1. I am glad that my post helped :)

    2. I have read your blog its very attractive and impressive. I like it your blog.

      Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

      Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

  2. Getting an error after following the 7th step. Please help.

    -- Configuring incomplete, errors occurred!

    1. didn't work for me either, try this one:

  3. Also get errors on 7th.. Followed every bit, except I had to replace libjpeg62-dev with libjpeg-dev because of compatibility coplaints.

  4. Check for the mentioned problems. Or better follow if you are using Ubuntu. Installation is silent without output for a few minutes right after the start. But then it works smoothly.

  5. step 7 worked for me after I executed this:
    sudo apt-get install libqt4-core libqt4-dev libqt4-gui qt4-dev-tools

  6. To work on OpenCV with Python visit --

  7. Step 7: it is missing C before MAKE, so this is the correct way
    -D CMAKE_INSTALL_PREFIX=/usr/local

  8. Hello. I am using Ubuntu 12.04.
    and i want to install OpenCV 2.4.8.
    I want to ask that will this guide work on Ubuntu 12.04? Have anyone tried this guide over Ubuntu 12.04?
    And how to configure OpenCV with CodeBlocks IDE?
    Any help will be highly appreciated. Thanks.

    1. Process should be pretty much similar. Try to follow above blog post and see if it works

  9. for everybody getting stuck at step 7, you might consider trying the following:
    (works for ubuntu 14.1, should work for previous versions also)
    >type 'sudo synaptic' on terminal
    >search for qt4-default and install it.

    The thing is that installing via synaptic installs all the dependencies implicitly, which doesn't lead to broken packages you might be facing.

  10. Herpes, a very hot topic these days, almost everyone is suffering from this, i am also suffering from this disease. And we all know that there is no cure for the herpes. But now days some of the sompanies are claiming that they discovered the herpes cure. I don't know they are original or fakes but i tryed one of these. And the Herpes Natural Cure they provided is really so good. I don't face any symptoms of herpes till now. To go to that website just Click Here .

  11. I am sure this post has helped me save many hours of browsing other related posts just to find what I was looking for. Many thanks!

    angularjs6-Training in chennai

    angularjs Training in online

    angularjs4-Training in online

    angularjs-Training in tambaram