ข้ามไปที่เนื้อหาหลัก

บทความ

กำลังแสดงโพสต์จาก กรกฎาคม, 2009

หน้า มหาลัย ตอนดึกๆ

เมื่อวาน กำลังจะกลับบ้าน ฝนเจ้ากรรม ดันตกซะหนักเลย เลยต้องรอรถเมล์ไป ฟิวเจอร์ รอน๊าน นาน เลยเอามือถือ มากด ถ่ายรูปซะหน่อย ปล. อยากไปเที่ยววว

[ GIMP ] TIFF save cannot handle indexed images with alpha channel.

gimp Problem : TIFF save cannot handle indexed images with alpha channel. Solution : Right click at Layer > Remove alpha channel

printf format reference

จดไว้กันลืม d , i Print an int as a signed decimal number. ' %d ' and ' %i ' are synonymous for output, but are different when used with scanf () for input. u Print decimal unsigned int . (short) // can print unsigned char as well f , F Print a double in normal ( fixed-point ) notation. 'f' and 'F' only differs in how the strings for an infinite number or NaN are printed ('inf', 'infinity' and 'nan' for 'f', 'INF', 'INFINITY' and 'NAN' for 'F'). e , E Print a double value in standard form ([-]d.ddd e[+/-]ddd).An E conversion uses the letter E (rather than e) to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. g , G Print a double in either normal or exponential notation, whichever is more appropriate for its magnitude. 'g' uses lower-case letters, 'G' uses upper-case letters. This type ...

[ 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 , dou...

[ SOLVED ] dell vostro 1310 laptop's keyboard not working when start ubuntu ( วิธีแก้ โน๊ตบุ๊ค DELL คีย์บอร์ดค้าง เมื่อเปิด อุบันตู )

My friends face this problem, so I think it's good to note it here. Just add "i8042.reset" to /boot/grub/menu.lst For example, kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=45c7e398-1ba6-4315-81cc-4ec620618efa ro quiet splash i8042.reset ref : ubuntuforums

[ eclipse c cpp ] มาเขียน cpp ด้วย eclipse กันเถอะ how to build, compile, add external library path, set environment variable

You can get "Eclipse IDE for C/C++ Developers" from Eclipse download Create New File New > Source File Build You have to build before run, otherwise you will got error. "Launch failed. Binary not found". build (Ctrl+B) add external library (-l) set environment variable eclipse tips 'open declaration (F3)' in eclipse is 'go to definition' in virtual studio eclipse comment multiple line highlight the line and "ctrl + /" uncomment use the same shortkey "ctrl + /" c++ HelloWorld program #include <stdio.h> int main(){ printf("Hello"); } Trick : exclude from build If you have multiple main() file you may wanna exclude some file from build, otherwise you will got an error "multiple definition of main". right click at the file that you wanna exclude > Properties related topic : create c++ shared library in eclipse see other eclipse topic

[ ubuntu ] OpenCV in gedit

จิ้มไปจิ้มมา เผลอกด OK หายอีกกรู จดไว้ก่อน คราวหน้าจะได้ไม่ต้องไปงมอีก MY_FILENAME=`echo $GEDIT_CURRENT_DOCUMENT_PATH | cut -d . -f 1` gcc -o $MY_FILENAME $GEDIT_CURRENT_DOCUMENT_PATH -I${HOME}/opencv/include/opencv/ -L${HOME}/opencv/lib -lhighgui export LD_LIBRARY_PATH=${HOME}/opencv/lib $MY_FILENAME -I : Directories -L : Library search path -l : Libraries LD_LIBRARY_PATH is for running a code. If it is not set, you will come up with error like this. error while loading shared libraries: libhighgui.so.2: cannot open shared object file: No such file or directory ข้างล่างนี่ ยัดแบบเต็มๆ เอา levmar กับ sift เข้าไปด้วยเลย MY_FILENAME=`echo $GEDIT_CURRENT_DOCUMENT_PATH | cut -d . -f 1` export LD_LIBRARY_PATH=${HOME}/opencv/lib gcc -o $MY_FILENAME $GEDIT_CURRENT_DOCUMENT_PATH -I${HOME}/opencv/include/opencv/ -I/mnt/disk/AIT/OpenCV/sift/include/ -L${HOME}/opencv/lib -L${HOME}/levmar-2.4 -L/mnt/disk/AIT/OpenCV/sift/lib/ -lhighgui -lm -llapack -llevmar -lfeat $MY_FILENAME เราสามารถใช้ Enviro...

[ 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’ und...

Try "google earth" for "linux" on "ubuntu"

Download from here Installation $ chmod +x GoogleEarthLinux.bin $./GoogleEarthLinux TIPS : At fly to .., you can also search from latitude and longitude ( i.e. 37 25 19.07 N, 122 05 06.24 W ). see another support format from google

[ matlab ] uniform distribution of random

The random number from > > round(rand(1)*1000) does not have uniform distribution. You should use > > floor(101*rand) or > > ceil(101*rand-1) to get a uniform distribution. Each number would then have a probability of 1/101 of being chosen. In general, to get uniformly distributed integers in the range [m,n] (including the endpoints) use: > > floor((n-m+1)*rand+m) or > > ceil((n-m+1)*rand+m-1) or you can use > > temp=randperm(n); > > random_integer=temp(1); ref : derkeiler

RANdom SAmple Consensus (RANSAC) algorithm

Introduction fig. 1 picture from 'Multiview geometry in Computer Vision' book. If you use orthogonal regression ( minimizes the sum of squared perpendicular distances -- LMS ), there will be a problem if you have an outliers (see fig 1a). RANSAC algorithm RANSAC algorithm will cope with this problem by discarding outliers. Slide from 25th year of RANSAC, Philip Torr slides has very clear picture of the algorithm. support = number of points that lie within a distance threshold points within the threshold distance of a line with most support are the inliers. If a point is an outliers , a line will not have so much support. ( see fig 1b from mvg book above ) Explain the algorithm - First we randomly pick two red point and estimate m, c for y=mx+c ( this is easy, right ) - for consider if a point is a inlier for every yellow point (x, y) If | y - (m*x + c) | < t, number of inlier need to justify model -- re-estimate m, c again by using all ...

eclipse install plugin

Installation  Method 1 : Install directly to eclipse folder just extract zip file. and place into 'plugins' folder on eclipse home. Method 2 : Help > Install New Software... Add and at the Location : click Archieve and choose zip file see other eclipse topic . Method 3 : Help > Eclipse marketplace Check whether the plugin is installed Goto Help > About > Installation Details > Plug-ins and check whether it is there NOTE : some plugin did not compatable with old version of java For example, TestNG version 6.9.9.201510270734  requires at lease JDK 7 The installation does not pop any error, but it does not shown up anywhere including in Preferences and Help > About > Installation Details > Plug-ins To use TestNG on the old eclipse we have to download the older version from http://beust.com/eclipse-old/ or the below is the direct link to the highest version that support Java 6 http://beust.com/eclipse-old/eclipse_6.9.5...

Derby Database Installation on ubuntu

Installation 1. download bin installation from derby's download page 2. set environment variable in /etc/environment or ~/.bashrc or ~/.bash_aliase export JAVA_HOME=/usr/lib/jvm/java-6-sun export PATH=$PATH:$JAVA_HOME/bin export DERBY_INSTALL=/mnt/disk/AIT/Quality/db-derby-10.5.1.1-bin // change this into your derby installation path export CLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:. 3. run $ cd $DERBY_INSTALL/bin $ . setEmbeddedCP and terminal will close, don't be panic. go on to next steps. 4. Testing if installation is correct $ java org.apache.derby.tools.sysinfo Result should be something like this. ------------------ Java Information ------------------ Java Version: 1.6.0_13 Java Vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-sun-1.6.0.13/jre Java classpath: /mnt/disk/AIT/Quality/db-derby-10.5.1.1-bin/lib/derby.jar:/mnt/disk/AIT/Quality/db-derby-10.5.1.1-bin/lib/derbytools.jar:. OS name: Linux OS archi...