

I will use one of the frontal face detectors available. You need to tell OpenCV which training data to use. Some of the training data for object detection is stored in /usr/local/share/opencv/haarcascades. Let’s check some demos included in OpenCV:Ĭp OpenCV-2.1.0/samples/c/* openCV_samples

Now you have OpenCV 2.1 installed in your computer. OpenCV will not work correctly until you do this. PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfigįinally, open a new console, restart the computer or logout and then login again. Run the following code to configure the library:Īdd these two lines at the end of the file and save it: First, open the nf file with the following code:Īdd the following line at the end of the file(it may be an empty file, that is ok) and then save it: Now, you are ready to compile and install OpenCV 2.1: If this is not the case you will not be able to read or write videos. Note that there is a dot at the end of the line, it is an argument for the cmake program and it means current directory.Ĭheck that the above command produces no error and that in particular it reports FFMPEG as 1. Just execute the following line at the console. Therefore you need to use Cmake to generate the makefile. In this version of OpenCV, the configure utility has been removed.

The next step is to get the OpenCV 2.1 code: Sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev cmake libswscale-dev libjasper-dev I have used this procedure for previous versions of Ubuntu as well with minor modifications (if any).įirst, you need to install many dependencies, such as support for reading and writing jpg files, movies, etc… This step is very easy, you only need to write the following command in the Terminal Here are the steps that I used to successfully install OpenCV 2.1 in Ubuntu 9.10. UPDATE: Install OpenCV 2.2 in Ubuntu 11.04 with Python and TBB support here. Since it contains many bug fixes and some nice new additions, I will show you how to install it. Unfortunately, the newer version of OpenCV, 2.1, which was released on April has a slightly different installation procedure. You can install OpenCV 2.0 by following one of my previous posts OpenCV 1.0 can be easily installed in Ubuntu via the repositories. I have been using it for years and it helped me a lot during my master thesis. OpenCV is an excellent library for Computer Vision. UPDATE: You can also install OpenCV 3.2.0 in Ubuntu 16.04LTS.
