To install OpenCV library in Ubuntu from source, I tried these steps. The code of OpenCV is not the last but the one which is in the Ubuntu repository. If you want to install the last version just download it from the official SVN in sourceforge.
[ad#Amazon Opencv]
You can install opencv anywhere but its best you put in the propoer place
1) Sign as root
sudo su
2) Go to
cd /usr/local/src
3) prepare your environment
apt-get install build-essential
4) prepare your environment
apt-get install dpkg-dev
5) Download opencv packages
apt-get source opencv
6) Go to extracted opencv folder
cd opencv-1.0
7) List all dependency package informed in
more /debian/control
Install all dependency package informed in /debian/control by invoking
apt-get install [package-1] package-2] [packga-3] ... [package-n]
9) Also install other necessary package
apt-get install fakeroot ffmpeg quilt
10) Build package by invoking
dpkg-buildpackage -us -uc -rfakeroot
11) Go to samples folder
cd /samples/c
12) Build samples
make -f Makefile.debian
13) Plug in your webcam and run the samples
./facedetect
14) See you face detected in monitor