วันศุกร์ที่ 17 กรกฎาคม พ.ศ. 2552

[ ubuntu ] LVM Opensource installation

1. download from http://www.ics.forth.gr/~lourakis/levmar/

At the time that I am writing this blog, current version is levmar-2.4 and ubuntu 9.04.

2.
$ make

NOTE :

- you have to install "liblapack-dev" to prevent
/usr/bin/ld: cannot find -llapack
- install "libf2c2-dev" to prevent
/usr/bin/ld: cannot find -lf2c
but you also have a problem with f2c anyway
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libf2c.so: undefined reference to `MAIN__'
following suggestion here.

Just add "-u MAIN__" to Makefile. So change from
lmdemo: $(DEMOBJS) liblevmar.a
$(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -llevmar $(LIBS) -lm
to
lmdemo: $(DEMOBJS) liblevmar.a
$(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -llevmar $(LIBS) -lm -u MAIN__

3. Test by compile demo
$ gcc lmdemo.c -o lmdemo1 -L/mnt/disk/AIT/OpenCV/levmar-2 -lm -llapack -llevmar


NOTE :
dlevmar_dif(costFunc, p0, x0, mlevmar, nlevmar, 1000, opts, info, NULL, NULL, NULL); // no Jacobian

void costFunc(double *p, double *tran_x, int m, int n, void *data);

what levmar did is change p, we have change tran_x.
levmar will compare tran_x to x0 then change p again to optimize p0. ( by minimize sum(tran_xi-x0i)^2 )

Therefore, you can put any order of params into p0, x0. For example, you can put x0 = [x; x'] or x0 = [x'; x] or whatever.

1 ความคิดเห็น:

ไม่ระบุชื่อ กล่าวว่า...

Thank you man :) you saved my project :) let forge be with you !!

LinkWithin

Related Posts Plugin for WordPress, Blogger...