Note for English Readers

If I write the articles in Indonesian, I will write a summary in English so that you can read my articles too. After you read the summary and you feel that you need more information about that, please do not hesitate to contact me via e-mail that can be found in my profile.

Thank you for reading my blogs.
Showing posts with label opencv. Show all posts
Showing posts with label opencv. Show all posts

Monday, October 12, 2009

Kompilasi dan Instalasi OpenCV 2.0.0 pada Linux -- Compiling & Installing OpenCV 2.0.0 on Linux --

Seperti yang telah saya janjikan pada tulisan sebelumnya, sekarang saya ingin membagikan pengalaman saya saat melakukan kompilasi dan instalasi OpenCV 2.0.0 di laptop saya. Distro Linux yang saya gunakan adalah Slackware64 13.0, tapi, menurut saya, pengalaman saya ini merupakan pengalaman untuk Linux secara umum, tidak tergantung distro. OK, kita mulai ...

Langkah pertama, sudah pasti, kita harus memastikan semua dependencies dari OpenCV 2.0.0 telah terinstall dengan baik pada PC/Laptop kita. Biasanya, untuk OpenCV, saya inginnya yang lengkap. Ada beberapa program yang merupakan dependencies dari OpenCV 2.0.0 yang "harus ada" (menurut kebutuhan dan mau saya), antara lain: xinelib, ffmpeg, libdc1394, v4l, swig, python, libjpeg, zlib, libpng, libtiff, libjasper. Untuk Slackware/Slackware64 13.0, beberapa dependencies seperti xinelib, swig, python, libjpeg, zlib, libpng, libtiff, dan libjasper telah terinstall; saya hanya perlu menambahkan ffmpeg, libdc1394, dan v4l. Mengenai cara mencari dan menambahkan dependencies, silakan dibaca pada manual distro masing-masing.

Setelah semua dependencies sudah terinstall, langkah kedua adalah kompilasi OpenCV 2.0.0. Untuk versi 2.0.0 ini, ada 2 cara kompilasi, yang pertama, cara klasik, menggunakan configure dan make; cara yang kedua adalah menggunakan cmake dan make. Saya telah mencoba kedua cara tersebut. Untuk yang menggunakan cmake, sebenarnya cara ini lebih mudah dan user-friendly (sejauh yang saya rasakan) tapi saat saya coba, setelah 85% proses kompilasi, muncul error.

# cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_LATEX_DOCS=ON ..

Jika tidak ada error, lalu:

# make

Error yang muncul:

...
Linking CXX shared library ../../lib/libcvaux.so
[ 84%] Built target cvaux
Scanning dependencies of target cvhaartraining
[ 84%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvboost.o
[ 84%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvcommon.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvhaarclassifier.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvhaartraining.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvsamples.o
Linking CXX static library ../../lib/libcvhaartraining.a
[ 85%] Built target cvhaartraining
Scanning dependencies of target createsamples
[ 85%] Building CXX object apps/haartraining/CMakeFiles/createsamples.dir/createsamples.o
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libhighgui.so.2.0.0: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make: *** [all] Error 2

Sampai sekarang, saya masih belum tahu sebabnya. Saya telah menanyakan ke forum OpenCV, belum ada jawaban, mungkin tidak ada yang mengalaminya, karena jika saya amati dari respon anggota forum, mayoritas bukan pengguna Linux.
Akhirnya, saya pakai cara klasik:

$ ./configure --with-xine --with-ffmpeg --with-1394libs --with-v4l --with-gtk --without-quicktime --enable-sse --with-swig --with-python --with-gthread

Jika tidak ada error, lalu:

$ make

Kompilasi sukses.

Langkah ketiga, install hasil kompilasi tersebut menggunakan make install. Pastikan Anda telah menjadi root user atau superuser saat menginstall:

# make install

Langkah terakhir adalah mencoba OpenCV 2.0.0. Kebetulan, 2 tahun lalu, saya pernah menulis di blog ini tentang cara membuat program dengan library OpenCV pada Linux. Program-program tersebut saya coba untuk di-compile ulang menggunakan library OpenCV versi 2.0.0 dan hasil kompilasinya dapat berjalan mulus pada laptop saya. Sekedar mengingatkan, cara kompilasi menggunakan library OpenCV adalah sebagai berikut:

$ g++ -Wall [nama_file].cpp -o [nama_file_output] `pkg-config opencv --cflags --libs`

Contoh:

$ g++ -Wall trial1.cpp -o trial1 `pkg-config opencv --cflags --libs`


Referensi:


Summary:
This article describes about compiling and installing OpenCV on Linux in general, not depending on Linux distros. All writings of this article are based on reference at OpenCV wiki site that you can find the link on Referensi. There are 4 steps that I've been worked that I will discuss.

First, make sure all dependencies of OpenCV have been installed properly. By my experience, I need xinelib, ffmpeg, libdc1394, v4l, swig, python, libjpeg, zlib, libpng, libtiff, and libjasper. For how to add dependencies, please consult to each distro's manual.

Second, compiling OpenCV. There are 2 methods, classical method (configure then make) and cmake method. When I tried cmake method using this command:

# cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_LATEX_DOCS=ON ..

I found an error when the process has been 85% finished.

...
Linking CXX shared library ../../lib/libcvaux.so
[ 84%] Built target cvaux
Scanning dependencies of target cvhaartraining
[ 84%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvboost.o
[ 84%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvcommon.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvhaarclassifier.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvhaartraining.o
[ 85%] Building CXX object apps/haartraining/CMakeFiles/cvhaartraining.dir/cvsamples.o
Linking CXX static library ../../lib/libcvhaartraining.a
[ 85%] Built target cvhaartraining
Scanning dependencies of target createsamples
[ 85%] Building CXX object apps/haartraining/CMakeFiles/createsamples.dir/createsamples.o
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libhighgui.so.2.0.0: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make: *** [all] Error 2

Until now, I still don't know how to solve it. There is no response from OpenCV forum, perhaps, nobody got this error when compiling OpenCV 2.0.0.

I switched the method using classical method:

$ ./configure --with-xine --with-ffmpeg --with-1394libs --with-v4l --with-gtk --without-quicktime --enable-sse --with-swig --with-python --with-gthread

If no error, lalu:

$ make

I found no error until compilation finished.

Third, install the compiled OpenCV using (note: make sure you have been a root user or superuser when execute this command):

# make install

The last step is try to make a simple program that needs OpenCV library then compile it using:

$ g++ -Wall [input_file].cpp -o [output_file] `pkg-config opencv --cflags --libs`

Thursday, October 8, 2009

OpenCV 2.0.0 telah dirilis

-- Sorry, I wrote this article in Indonesian only. For information related to OpenCV 2.0.0 in English, please go to the OpenCV Wiki Site (see Referensi for the link) --

OpenCV merupakan suatu library kumpulan fungsi-fungsi pemrograman yang khusus ditujukan untuk real-time computer vision. Aplikasinya cukup luas, antara lain: Human-Computer Interaction (HCI), Object Identification, Segmentation and Recognition, Face Recognition, Gesture Recognition, Motion Tracking, Ego Motion, Motion Understanding, Structure From Motion (SFM), Stereo and Multi-Camera Calibration and Depth Computation, Mobile Robotics.

Bagi yang berkecimpung dalam bidang computer vision, terutama real-time computer vision, ada kabar yang menggembirakan, yaitu, pada tanggal 30 Sept. 2009, telah dirilis OpenCV versi 2.0.0. Beberapa penambahan fitur pada versi 2.0.0 ini bila dibandingkan dengan OpenCV 1.1pre1 antara lain:
  • bug fixed.
  • The brand-new C++ interface untuk sebagian besar fungsi pada OpenCV (cxcore, cv, highgui).
  • Build system menggunakan CMake.
  • Perbaikan pada fungsi-fungsi aljabar linier.
  • Support bicubic and Lanczos interpolation.
  • Support stereo camera (Linux).
  • Image dapat dikompress dan di-dekompress langsung pada buffer memory
  • Beberapa fungsi dasar dan operasi image processing (seperti operasi aritmatika, geometric image transformations, filtering, dll) telah mempunyai optimasi SSE2 sehingga fungsi-fungsi tersebut akan bekerja beberapa kali lebih cepat daripada versi sebelumnya.
  • dll.
Untuk lebih detilnya, silakan menuju ke link yang tercantum pada bagian referensi.

Instalasi OpenCV 2.0.0 for Linux dengan cara meng-compile sendiri dari source akan saya bahas kemudian. So ... be patient! :))

Referensi:

Wednesday, September 19, 2007

Capturing Frames from a USB Camera using OpenCV on Linux

Next step after loading image and manipulating it, I try to access a Linux-USB-registered USB Camera using a simple camera capture framework written in C with OpenCV Library. Here is the code:

/////////////////////////////////////////////////////
// trialcam1a.cpp
// A Simple Camera Capture Framework
// This program will connect to a camera then
// show the frames in a window
/////////////////////////////////////////////////////

#include <stdio.h>
#include <cv.h>
#include <highgui.h>

int main()
{
IplImage *frame = NULL; //Preparing frame pointer
int key;


//Allocates and initializes cvCapture structure

// for reading a video stream from the camera.
//Index of camera is -1 since only one camera

// connected to the computer or it does not
// matter what camera to use.
CvCapture *input_camera = cvCaptureFromCAM(-1);

//Grabs and returns a frame from camera

frame = cvQueryFrame
(input_camera);

//Creates window for displaying the frames
//Flag is reset (0) --> change window size
// manually

cvNamedWindow("Capturing Image ...", 0);

//Change to the appropriate size. In GTK, the
// inappropriate size will return a segmentation
// fault. I don't know why ...
//Gets the appropriate size using cvGetCaptureProperty
// with CV_CAP_PROP_FRAME_HEIGHT and CV_CAP_PROP_FRAME_WIDTH
// as property_id
cvResizeWindow("Capturing Image ...",
(int) cvGetCaptureProperty(input_camera, CV_CAP_PROP_FRAME_HEIGHT),

(int) cvGetCaptureProperty(input_camera, CV_CAP_PROP_FRAME_WIDTH));

while(frame != NULL)
{
//Shows a frame
cvShowImage("Capturing Image ...", frame);


//Checks if ESC is pressed and gives a delay
// so that the frame can be displayed properly

key = cvWaitKey(10);
if(key == 27)

break;
//Grabs and returns the next frame
frame = cvQueryFrame(input_camera);
}

//Release cvCapture structure
cvReleaseCapture(&input_camera);

//Destroy the window
cvDestroyWindow("Capturing Image ...");


return 0;
}

Compiling (in the working directory):
$ g++ -Wall trialcam1a.cpp -o trialcam1a `pkg-config --cflags --libs opencv`

Running (in the working directory):
$ ./trialcam1a

Screenshot:


dmesg when I plugged USB Camera:
usb 3-1: new full speed USB device using uhci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
Linux video capture interface: v2.00
pwc: Philips webcam module version 10.0.13 loaded.
pwc: Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.
pwc: Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,
pwc: the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.
pwc: Logitech QuickCam 4000 Pro USB webcam detected.
pwc: Registered as /dev/video0.
usbcore: registered new interface driver Philips webcam
usbcore: registered new interface driver snd-usb-audio

Camera driver: pwc.
Camera interface: v4l (Video for Linux).

References:
  • OpenCV wiki (http://opencvlibrary.sourceforge.net)
  • Introduction to programming with OpenCV, by Gady Agam (http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html)
  • Linux-uvc-devel mailing list, January 2007 archieve, e-mail posting by Jose Luis Landabaso

Monday, September 17, 2007

Compiling OpenCV Program on Linux

After OpenCV installation, I try to make a simple OpenCV program that loads an image from file, clones it, inverts it, and displays it at monitor, then, compile it on Linux. Here is the code:

//////////////////////////////////////////////////////////////////
//
// trial1a.cpp
//
// This is a simple, introductory OpenCV Program. The program will
// read an image from a file, clone it, invert it, and display the
// result.

//
//////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>

int main(int argc, char *argv[])
{
IplImage* img = 0;
IplImage* img1 = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;

if(argc<2)
{
printf("Usage: main \n\7");
exit(0);
}

//load an image
img1=cvLoadImage(argv[1]);
if(!img1)
{
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}

//clonning the image before processing
img=cvCloneImage(img1);

//get the image data
height=img->height;
width=img->width;
step=img->widthStep;
channels=img->nChannels;
data=(uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);

//create a window
cvNamedWindow("Image Window",CV_WINDOW_AUTOSIZE);
cvMoveWindow("Image Window",0,0);

//show the original image
cvShowImage("Image Window",img1);
//wait for input any key
cvWaitKey(0);

//invert the image
for(i=0;i<height;i++)
for(j=0;j<width;j++)
for(k=0;k<channels;k++)
*(data+(i*step+j*channels+k))=255-*(data+(i*step+j*channels+k));

//create another window
cvNamedWindow("Invert Image Window",CV_WINDOW_AUTOSIZE);
cvMoveWindow("Invert Image Window",500,0);

//show the inverted image
cvShowImage("Invert Image Window",img);
//wait for input any key
cvWaitKey(0);

//release the image
cvReleaseImage(&img1);
cvReleaseImage(&img);
return 0;
}

After typing and saving it using Kate Editor, I compile using gcc with command (in the working directory):
$ g++ -Wall trial1a.cpp -o trial1a `pkg-config --cflags --libs opencv`
Note that the option `pkg-config --cflags --libs opencv` will inserts -I/usr/local/include/opencv -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml automatically to the command. If that is not working, you can try this:
$ g++ -Wall trial1a.cpp -o trial1a -I/usr/local/include/opencv -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml

Next, if there are no errors, I type (in the working directory):
$ ./trial1a foto.jpg
Then ... (see screenshots)




References:
  • OpenCV wiki (http://opencvlibrary.sourceforge.net)
  • Introduction to programming with OpenCV, by Gady Agam (http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html)

Installing OpenCV from source, especially on x86_64 Linux system that has multilib support

Yesterday, I spent many hours to find out why I could not use OpenCV in Slamd64 after compiling and installing from the source. Finally, I found the problem: something related to multilib support in Slamd64, especially when I configured OpenCV to use GTK+-2.0. In Slamd64 system that has multilib support, it has two version of GTK+-2.0, i.e. 32-bit version and 64-bit version. Until now, I don't understand, when in the configuring process of OpenCV source, why that process "choose" the 32-bit version of GTK+-2.0 instead of 64-bit version, so that, I got error in compiling process and if didn't get error, ld could not link the OpenCV library to my program when I run gcc. I will check later if I have time :)

How to Compile OpenCV from source, especially on x86_64 Linux system that has multilib support
Note for user that doesn't use x86_64 Linux OS: after first step, you can skip the second.
First, make sure ffmpeg has been installed. Read the INSTALL documentation in OpenCV source tree. Other libraries that may be needed such as xine-lib, ieee1394 library (libraw1394 and libdc1394), video for linux (usually already included in kernel), libjpeg, zlib, libpng, libtiff, libjasper, libIlmImf are optional. Make sure to install those libraries before configuring/compiling OpenCV if it's necessary.
Second, to make sure the configuring process of OpenCV source "choose" the 64-bit version of GTK+-2.0, you have to edit 2 lines from the configure file in OpenCV source tree because you cannot add them as options when you type ./configure on bash prompt :(

For GTK_LIBS:
  • find this line: GTK_LIBS=`$PKG_CONFIG --libs ""gtk+-2.0 gdk-pixbuf-2.0""`
  • change to this (NOTE THAT THE CODE MAY VARY IN YOUR SYSTEM!): GTK_LIBS="-L/usr/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0"
How to get "-L/usr/lib64 ..."?
$ pkg-config --libs ""gtk+-2.0 gdk-pixbuf-2.0""
You will get: -L/usr/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
Copy that line to configure file and change /usr/lib to /usr/lib64.


For GTK_CFLAGS:
  • find this line: GTK_CFLAGS=`$PKG_CONFIG --cflags ""gtk+-2.0 gdk-pixbuf-2.0""`
  • change to this (NOTE THAT THE CODE MAY VARY IN YOUR SYSTEM!): GTK_CFLAGS="-DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12"
How to get "-DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 ..."?
$ pkg-config --cflags ""gtk+-2.0 gdk-pixbuf-2.0""
You will get: -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12
Copy that line to configure file and change /usr/lib/gtk-2.0/include to /usr/lib64/gtk-2.0/include


For GTHREAD_LIBS:
  • find this line: GTHREAD_LIBS=`$PKG_CONFIG --libs ""gthread-2.0""`
  • change to this: GTHREAD_LIBS="-L/usr/lib64 "`$PKG_CONFIG --libs ""gthread-2.0""`


Third,
$ ./configure --with-xine --with-ffmpeg --with-1394libs --with-v4l --with-gtk --without-quicktime
It indicates that OpenCV uses xine, ffmpeg, ieee1394, video for linux, and GTK+-2.0 libraries but disables quicktime library. OpenCV will be installed in default prefix (/usr/local) For detailed options, type ./configure --help
Here is some results of the configure in my laptop:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
...
...
...
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking for Carbon/Carbon.h... no
checking for pkg-config... /usr/bin/pkg-config
checking for "gtk+-2.0 gdk-pixbuf-2.0"... yes
checking GTK_CFLAGS... -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12
checking GTK_LIBS... -L/usr/lib64 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
checking for "gthread-2.0"... yes
checking GTHREAD_CFLAGS... -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
checking GTHREAD_LIBS... -L/usr/lib64 -pthread -lgthread-2.0 -lglib-2.0
checking xine.h usability... yes
checking xine.h presence... yes
checking for xine.h... yes
checking for xine_init in -lxine... yes
checking ffmpeg/avcodec.h usability... yes
checking ffmpeg/avcodec.h presence... yes
checking for ffmpeg/avcodec.h... yes
checking for avcodec_decode_video in -lavcodec... yes
checking for av_open_input_file in -lavformat... yes
checking libraw1394/raw1394.h usability... yes
checking libraw1394/raw1394.h presence... yes
checking for libraw1394/raw1394.h... yes
checking for raw1394_new_handle in -lraw1394... yes
checking libdc1394/dc1394_control.h usability... yes
checking libdc1394/dc1394_control.h presence... yes
checking for libdc1394/dc1394_control.h... yes
checking for dc1394_camera_on in -ldc1394_control... yes
checking linux/videodev.h usability... yes
checking linux/videodev.h presence... yes
checking for linux/videodev.h... yes
checking for linux/videodev2.h... yes
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_destroy_decompress in -ljpeg... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzopen in -lz... yes
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking libpng/png.h usability... yes
checking libpng/png.h presence... yes
checking for libpng/png.h... yes
checking for png_read_image in -lpng12... yes
checking for png_get_valid... yes
checking for png_set_tRNS_to_alpha... yes
checking tiff.h usability... yes
checking tiff.h presence... yes
checking for tiff.h... yes
checking for TIFFReadRGBAStrip in -ltiff... yes
checking jasper/jasper.h usability... yes
checking jasper/jasper.h presence... yes
checking for jasper/jasper.h... yes
checking for jas_image_readcmpt in -ljasper... yes
checking ImfCRgbaFile.h usability... no
checking ImfCRgbaFile.h presence... no
checking for ImfCRgbaFile.h... no
configure: Checking for necessary tools to build python wrappers
checking for python... /usr/bin/python
checking for python version... 2.5
checking for python platform... linux2
checking for python script directory... ${prefix}/lib64/python2.5/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python2.5/site-packages
configure: PYTHON_CSPEC=-fPIC -I/usr/include/python2.5
configure: PYTHON_LSPEC= -L/usr/lib64/python2.5/config -lm -lpthread -ldl -lutil -lpython2.5 -Xlinker -export-dynamic
checking Python.h usability... yes
checking Python.h presence... yes
checking for Python.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating opencv.pc
config.status: creating opencv.spec
config.status: creating docs/Makefile
config.status: creating data/Makefile
config.status: creating cxcore/Makefile
config.status: creating cxcore/include/Makefile
config.status: creating cxcore/src/Makefile
config.status: creating cv/Makefile
config.status: creating cv/include/Makefile
config.status: creating cv/src/Makefile
config.status: creating cvaux/Makefile
config.status: creating cvaux/include/Makefile
config.status: creating cvaux/src/Makefile
config.status: creating ml/Makefile
config.status: creating ml/include/Makefile
config.status: creating ml/src/Makefile
config.status: creating otherlibs/Makefile
config.status: creating otherlibs/highgui/Makefile
config.status: creating apps/Makefile
config.status: creating apps/haartraining/Makefile
config.status: creating apps/haartraining/include/Makefile
config.status: creating apps/haartraining/src/Makefile
config.status: creating interfaces/Makefile
config.status: creating interfaces/swig/Makefile
config.status: creating interfaces/swig/filtered/Makefile
config.status: creating interfaces/swig/general/Makefile
config.status: creating interfaces/swig/python/Makefile
config.status: creating tests/Makefile
config.status: creating tests/python/Makefile
config.status: creating tests/cv/Makefile
config.status: creating tests/cv/src/Makefile
config.status: creating tests/cxts/Makefile
config.status: creating tests/cxcore/Makefile
config.status: creating tests/cxcore/src/Makefile
config.status: creating utils/Makefile
config.status: creating samples/Makefile
config.status: creating samples/c/Makefile
config.status: creating samples/python/Makefile
config.status: creating cvconfig.h
config.status: cvconfig.h is unchanged
config.status: executing depfiles commands

General configuration ================================================
Compiler: g++
CXXFLAGS: -Wall -fno-rtti -pipe -O3 -fomit-frame-pointer

Install path: /usr/local

HighGUI configuration ================================================

Windowing system --------------
Use Carbon / Mac OS X: no
Use gtk+ 2.x: yes
Use gthread: yes

Image I/O ---------------------
Use libjpeg: yes
Use zlib: yes
Use libpng: yes
Use libtiff: yes
Use libjasper: yes
Use libIlmImf: no

Video I/O ---------------------
Use QuickTime / Mac OS X: no
Use xine: yes
Use ffmpeg: yes
Use dc1394 & raw1394: yes
Use v4l: yes
Use v4l2: yes

Wrappers for other languages =========================================
SWIG
Python yes

Additional build settings ============================================
Build demo apps yes

Now run make ...

configure:
ATTENTION: highgui will be built with xine support,
thus it will be a subject to GNU Public License


Fourth and next ..., if there are no errors, then
$ make
# make install
Make sure you have root privilege to run make install.