Old: Ver.1 - 3: Compiling OpenCV on Ubuntu 10.04.1
Japanese,
Casper Cartridges,
kameda-lab.org
2010/11/22b, (2012/10/10)
Latest Version
New Casper Cartridge (newer than Ver.3) is ready now.
Access the page from this link.
Abstract
You are assumed to have a bootable USB memory stick of Ubuntu 10.04.1 LTS.
Basic Setup
- Time zone
[Menu] System - Administration - Time and Date
Then, Time zone : Asia/Tokyo (or where you live).
- System clock
If you set your local time to PC's system clock and you want to use that on Ubuntu too, turn off the UTC flag.
$ sudo gedit /etc/default/rcS
|
And then change "UTC=yes" to "UTC=no".
- Emacs
If you are going to install emacs, you can suppress error messages by:
$ sudo gedit /usr/share/themes/Ambiance/gtk-2.0/gtkrc
|
And then change "GtkRange::trough-under-steppers = 0" to "GtkRange::trough-under-steppers = 1".
Compile OpenCV 2.1.0
- Preparation
Some (freeglut3, dc1394, emacs) are not mandatory, but I recommend you to have these.
(If you seem to fail installing some packages, try "apt-get update" to catch up recent changes.)
$ sudo apt-get install freeglut3-dev
$ sudo apt-get install libdc1394-22-dev
$ sudo apt-get install cmake g++ libavformat-dev libswscale-dev
$ sudo apt-get update
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install emacs
|
- Download OpenCV
From OpenCV web site,
download
OpenCV-2.1.0.tar.bz2
.
Suppose you put that at your home, "/home/ubuntu".
- Exract OpenCV
$ cd
$ tar xvfj OpenCV-2.1.0.tar.bz2
|
- Quick-fix of SURF-zero-bug
SURF of OpenCV 2.1.0 sometims fails (dump) when there is few textures.
It is reported as a bug, so fix that in quick way.
[Ref : surf-crash.diff]
- Prepare building-directory of OpenCV
You can compile OpenCV source tree at different directoy by using cmake.
$ cd
$ mkdir OpenCV-2.1.0-build
$ cd OpenCV-2.1.0-build
|
- Compile OpenCV
Now it sholuld be easy.
$ cd
$ cd OpenCV-2.1.0-build
$ cmake ../OpenCV-2.1.0
$ make
$ sudo make install
$ sudo ldconfig
|
- All set!
You may reboot the system and enjoy!
Next
Let's go to OpenCV sample programs.
(KAMEDA, Yoshinari) kameda[at]iit.tsukuba.ac.jp, kameda[at]ieee.org