วันอังคารที่ 14 กรกฎาคม พ.ศ. 2552

[ ubuntu ] SIFT Opensource installation

1. download from
http://web.engr.oregonstate.edu/~hess/

2.
$ make
make -C ./src siftfeat
make[1]: Entering directory `/mnt/disk/AIT/OpenCV/sift/src'
gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` -c xform.c -o xform.o
Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
xform.c:16:24: error: gsl/gsl_sf.h: No such file or directory
xform.c:17:25: error: gsl/gsl_rng.h: No such file or directory
xform.c:18:29: error: gsl/gsl_randist.h: No such file or directory
xform.c:27: error: expected declaration specifiers or ‘...’ before ‘gsl_rng’
xform.c: In function ‘ransac_xform’:
xform.c:85: error: ‘gsl_rng’ undeclared (first use in this function)
xform.c:85: error: (Each undeclared identifier is reported only once
xform.c:85: error: for each function it appears in.)
xform.c:85: error: ‘rng’ undeclared (first use in this function)
xform.c:98: error: ‘gsl_rng_mt19937’ undeclared (first use in this function)
xform.c:105: error: too many arguments to function ‘draw_ransac_sample’
xform.c: At top level:
xform.c:393: error: expected declaration specifiers or ‘...’ before ‘gsl_rng’
xform.c: In function ‘draw_ransac_sample’:
xform.c:410: error: ‘rng’ undeclared (first use in this function)
make[1]: *** [xform.o] Error 1
make[1]: Leaving directory `/mnt/disk/AIT/OpenCV/sift/src'
make: *** [siftfeat] Error 2
As suggest here, you have to install "libgsl0-dev" for gsl and you have also to install "doxygen".

2.
$ gcc -I/path/to/sift/include/ -L/path/to/sift/lib/ yourcode.c \
-o yourexecutable -lfeat


3. try demo on match.c

$ ./match ../beaver.png ../beaver_xform.png 


Common problem

if running with SIFT RANSAC function ( ransac_xform ), you may face the following error.

add -lgsl to prevent error

/mnt/disk/AIT/OpenCV/sift/lib//libfeat.a(xform.o): In function `draw_ransac_sample':
xform.c:(.text+0x87b): undefined reference to `gsl_rng_uniform_int'
/mnt/disk/AIT/OpenCV/sift/lib//libfeat.a(xform.o): In function `calc_min_inliers':
xform.c:(.text+0x93c): undefined reference to `gsl_sf_lnchoose'
/mnt/disk/AIT/OpenCV/sift/lib//libfeat.a(xform.o): In function `ransac_xform':
xform.c:(.text+0x16ae): undefined reference to `gsl_rng_mt19937'
xform.c:(.text+0x16b6): undefined reference to `gsl_rng_alloc'
xform.c:(.text+0x16d4): undefined reference to `gsl_rng_set'
xform.c:(.text+0x172e): undefined reference to `gsl_sf_lnchoose'
xform.c:(.text+0x1846): undefined reference to `gsl_rng_uniform_int'
xform.c:(.text+0x19cc): undefined reference to `gsl_rng_free'
collect2: ld returned 1 exit status
make: *** [sift] Error 1


add -lgslcblas to prevent error

/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ztrsv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_scasum'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_izamax'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dnrm2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zdotc_sub'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cgemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cher2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cdotu_sub'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ddot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zdscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zsyr2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_chemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zgemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ccopy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_isamax'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ctrmv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cswap'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cgeru'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zher'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_daxpy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ctrsv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cdotc_sub'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zgemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_csyrk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ctrmm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sdsdot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_csscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dger'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ctrsm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsyrk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_icamax'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsyr'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsyr2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dtrmv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dasum'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsymv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_strsm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_srot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssyr'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_srotmg'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_scnrm2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_snrm2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zgeru'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zhemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dcopy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsyr2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_drotmg'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ztrmm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dtrmm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_srotm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_chemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dznrm2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_drotm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsymm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_strsv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sdot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssyr2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_idamax'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dtrsm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zhemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zsyrk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dzasum'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_csyr2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zgerc'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sgemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zher2k'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssyr2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zswap'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dgemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sgemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_csymm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_strmm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zsymm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_srotg'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_drotg'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zcopy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dswap'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cher'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ztrmv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zherk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_scopy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_caxpy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zscal'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cgerc'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssymm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ztrsm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cherk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssyrk'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sger'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_strmv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_saxpy'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dgemv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_drot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dsdot'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cgemm'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zdotu_sub'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sswap'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_cher2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_ssymv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_dtrsv'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zher2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_sasum'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgsl.so: undefined reference to `cblas_zaxpy'
collect2: ld returned 1 exit status
make: *** [sift] Error 1

ไม่มีความคิดเห็น:

LinkWithin

Related Posts Plugin for WordPress, Blogger...