OpenCv 2.3.1 build on ubuntu 12.04

Hi
download the OpenCv Source package from
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/
OpenCV-2.3.1a.tar.bz2/download

Download all the pre-requisite packages
Execute the below commands

apt-get install build-essential
apt-get install cmake
apt-get install pkg-config
apt-get install libpng12-0 libpng12-dev libpng++-dev libpng3
apt-get install libpnglite-dev libpngwriter0-dev libpngwriter0c2
apt-get install zlib1g-dbg zlib1g zlib1g-dev
apt-get install libjasper-dev libjasper-runtime libjasper1
apt-get install pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
apt-get install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-prog
apt-get install ffmpeg libavcodec-dev libavcodec52 libavformat52 libavformat-dev
apt-get install libgstreamer0.10-0-dbg libgstreamer0.10-0  libgstreamer0.10-dev
apt-get install libxine1-ffmpeg  libxine-dev libxine1-bin
apt-get install libunicap2 libunicap2-dev
apt-get install libdc1394-22-dev libdc1394-22 libdc1394-utils
apt-get install swig
apt-get install libv4l-0 libv4l-dev
apt-get install python-numpy
apt-get install libjpeg-progs libjpeg-dev

1.Run cmake-gui
2.Enter the source directory as OpenCV-2.3.1/build_1/2.3/opencv
3.Enter the binary build directory as OpenCV-2.3.1/build_1/2.3/opencv/build_2
4.Select the suitable options and click of configure
Select the suitable support libraries that are required.
5.Select generate to generate the make files
6.cd /media/LINUX/OpenCV-2.3.1/build_1/2.3/opencv/build_2
make -j4
7.make install

Errors encountered in OpenCv Build
1.cap_ffmpeg_impl.hpp:1128:90: error: ‘av_rescale_q’ was not declared in
this scope
Add #include <libavutil/mathematics.h> in the file cap_ffmpeg_impl.hpp before
#include <ffmpeg/avcodec.h>

Advertisements

One thought on “OpenCv 2.3.1 build on ubuntu 12.04

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s