Since I went to Germany in 2008, I start to write something that I have learned during my PhD study in Uni. Goettingen. Just two months ago (Marz, 20), I got my PhD degree and then came back to my homeland, China.
Unfortunately, I can not visit some Google services, e.g., Blogger, Document, Google Plus. They are just stopped in front of "Great wall".
That is something that I have nothing to do with. Therefore, I start a new Blogger: http://blog.sina.com.cn/robotdream
I have great time here. It is time to move on!
Saturday, June 30, 2012
Wednesday, April 25, 2012
To access multiple dimensional array in Java from C using JNI
It is a little bit tricky to use jni to access matrix in java from c/c++ code. Here is my example:
I really hate the blogger. I can past my source code. Anyway, you can send me email about how to do it.
Here the "tags" is a two dimensional array in java. I would like to access its data and save them to a matrix "tagPos" in c/c++;
jni getobjectclass function error "SIGSEGV"
Here is my code :
midMain = env->GetStaticMethodID( clsMTT, "TagCalculation", "()LReturnTags;");
tagInfo = env->CallStaticObjectMethod(clsMTT, midMain, NULL);
clsR = env->GetObjectClass(tagInfo);
When I run this program, I get the following the "SIGSEGV" error caused by GetObjectClass function.
The reason is the function "TagCalculation" returned a empty object "tagInfo" when I run "CallStaticObjectMethod".
Therefore, the GetObjectClass tries to find a class from an empty object. This will be wrong.
The solution is very simple: I change the function "TagCalculation" to always return a real object, which is not empty.
Then, the error gone.
midMain = env->GetStaticMethodID( clsMTT, "TagCalculation", "()LReturnTags;");
tagInfo = env->CallStaticObjectMethod(clsMTT, midMain, NULL);
clsR = env->GetObjectClass(tagInfo);
When I run this program, I get the following the "SIGSEGV" error caused by GetObjectClass function.
The reason is the function "TagCalculation" returned a empty object "tagInfo" when I run "CallStaticObjectMethod".
Therefore, the GetObjectClass tries to find a class from an empty object. This will be wrong.
The solution is very simple: I change the function "TagCalculation" to always return a real object, which is not empty.
Then, the error gone.
Friday, April 13, 2012
Install PTAM on Ubuntu 11.10
The PTAM is a nice augmented reality software, which is developed by Dr. Klein in 2008. It requires three dependencies: TooN, libcvd and gvars3. Since the ubuntu has upgraded to the 11.10 and libcvd also has its new version. When I try to install PTAM with new versions of ubuntu and dependencies, I have encountered some problems, such as " undefined reference to `typeinfo for CVD::V4L::RawV4LBuffer
" and “undefined reference to `dgesvd_’”.
The solution I found is from the website:
http://blog.icewu.tk/93/install-ptam-on-ubuntu-11-04.html
1. Edit the source file "cvd_src/v4l2buffer.cc:
2. Edit "cvd/v4l1frame.h" :
" and “undefined reference to `dgesvd_’”.
The solution I found is from the website:
http://blog.icewu.tk/93/install-ptam-on-ubuntu-11-04.html
1. Edit the source file "cvd_src/v4l2buffer.cc:
// #error "Can't do v4l2 for this kernel version"
#define K26(X) X
#define K24(X)
2. Edit "cvd/v4l1frame.h" :
#include#include
3. Edit "Makefile" in libcvd:
add cvd_src/Linux/v4lbuffer.o to CVD_OBJS
4. Install libcvd without the configuration (configure will change the makefile).
5. Edit "Makefile" in PTAM to include " -llapack -lblas":
LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -llapack -lblas
6. Install PTAM
Latex souce code of my presentation for the PhD defense
I thought it might be useful for someone who wants to use the latex for their presentations. In my case, I have used the latex graphical package TIKZ/PGF a lot. This package is very powerful and handy for drawing nice pictures, e.g., mind maps, arrows, coordinates, math plot, node chains.
Here I would like to publish my source code and share some magics (-:. You can download my thesis, presentation and its source code by clicking following links:
Guoliang Liu. "Bayes Filters with Improved Measurements For Visual Object Tracking", PhD Dissertation, University of Goettingen, Mar 2012. (PDF, PPT, LATEX CODE )
Here I would like to publish my source code and share some magics (-:. You can download my thesis, presentation and its source code by clicking following links:
Guoliang Liu. "Bayes Filters with Improved Measurements For Visual Object Tracking", PhD Dissertation, University of Goettingen, Mar 2012. (PDF, PPT, LATEX CODE )
Wednesday, April 11, 2012
API mismatch: nvidia
I upgrade my ubuntu, but the camera applications give me an error message: API mismatch: nvidia....
I find two versions of the nvidia in my system: one is from the ubuntu repository, i.e., nvidia-current. The other one was installed by myself long time ago by nvidia-installer.
The solution for this issue uses the following command:
sudo nvidia-installer --uninstall
Of course, you also can remove the nvidia-current and run nvidia-installer again. For me, the previous one is simpler.
I find two versions of the nvidia in my system: one is from the ubuntu repository, i.e., nvidia-current. The other one was installed by myself long time ago by nvidia-installer.
The solution for this issue uses the following command:
sudo nvidia-installer --uninstall
Of course, you also can remove the nvidia-current and run nvidia-installer again. For me, the previous one is simpler.
New paper: Square Root Sigma Point Information Filtering
Recently I have a paper accepted in IEEE Trans. on Automatic Control, which is a great journal. The paper is titled as "Square-Root Sigma-Point Information Filtering". The preprint version of this paper is available HERE. The abstract of this paper is following:
Abstract—The sigma-point information filters employ a number of
deterministic sigma-points to calculate the mean and covariance of a
random variable which undergoes a nonlinear transformation. These
sigma-points can be generated by the unscented transform or Stirling’s
interpolation, which corresponds to the unscented information filter (UIF)
and the central difference information filter (CDIF) respectively. In this
technical note, we develop the square-root extensions of UIF and CDIF,
which have better numerical properties than the original versions, e.g.,
improved numerical accuracy, double order precision and preservation of
symmetry. We also show that the square-root unscented information filter
(SRUIF) might lose the positive-definiteness due to the negative Cholesky
update, whereas the square-root central difference information filter
(SRCDIF) has only positive Cholesky update. Therefore, the SRCDIF
is preferable to the SRUIF concerning the numerical stability.
deterministic sigma-points to calculate the mean and covariance of a
random variable which undergoes a nonlinear transformation. These
sigma-points can be generated by the unscented transform or Stirling’s
interpolation, which corresponds to the unscented information filter (UIF)
and the central difference information filter (CDIF) respectively. In this
technical note, we develop the square-root extensions of UIF and CDIF,
which have better numerical properties than the original versions, e.g.,
improved numerical accuracy, double order precision and preservation of
symmetry. We also show that the square-root unscented information filter
(SRUIF) might lose the positive-definiteness due to the negative Cholesky
update, whereas the square-root central difference information filter
(SRCDIF) has only positive Cholesky update. Therefore, the SRCDIF
is preferable to the SRUIF concerning the numerical stability.
Wednesday, February 22, 2012
Very nice idea for presenting the GPA of student
It is not good to show the name of student on the manuscripts, an option to solve such a problem is to show the hash value of student name (plus some random number) using MD5 algorithm. However, the student needs to know his random number. An alternative is to use the matriculation number, so the student has to keep it as secrete, otherwise others may know your scores.
Monday, February 20, 2012
My public key on keyserver: http://keyserver.pgp.com
My public key (key ID: B92C8E6F) on keyserver: http://keyserver.pgp.com
gpg usage note
The gpg has a new version: 1.4.12. When I used gpg --gen-key, it outputted two pairs of keys: main keys for signing and verifying (pub), sub keys for encryption and decryption (sub). However, to encrypt something, it is not necessary to use sub key ID, you can use pub key ID instead.
A good explanation on this topic is here:
http://wlug.org.nz/GPG/PGPNotes
http://ubuntuforums.org/showthread.php?t=680292
A good explanation on this topic is here:
http://wlug.org.nz/GPG/PGPNotes
http://ubuntuforums.org/showthread.php?t=680292
Wednesday, February 15, 2012
A nice book binding shop in Goettingen (for publications,哥廷根书籍装订店)
Today is a big day for me, because I am going to submit my PhD thesis. Since the PCS program in University of Goettingen requires a binded thesis as a book, I have to find a binding shop. My colleague recommends a shop near the city center, which is Dieter Fischbach Buchbinderei. I brought the printed pages to there, and waited for about one hour. The final binded thesis is perfect, which is only cost 4.8 Euro for soft cover pages. Here is the location:
Monday, January 9, 2012
A very nice tutorial of paper writting for TOEFL
Welcome to the TOEFL-Prep Writing Practice Site
http://lrs.ed.uiuc.edu/students/fwalters/toeflwrite.html
http://lrs.ed.uiuc.edu/students/fwalters/toeflwrite.html
Friday, December 16, 2011
ssh refused to visit
If you got this problem ,first check if both computers have installed ssh.
This stupid problem wasted me few hours.
This stupid problem wasted me few hours.
vncviewer: keyboard mapping problem
If you encounter a problem of keyboard mapping when you use the vncviewer,
the solution is to add "export XKL_XMODMAP_DISABLE=1" to the file "~/.vnc/xstartup" on the server which looks like:
"
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
/etc/X11/Xsession
"
Of course, you have to restart xserver to implement the changes.
the solution is to add "export XKL_XMODMAP_DISABLE=1" to the file "~/.vnc/xstartup" on the server which looks like:
"
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
/etc/X11/Xsession
"
Of course, you have to restart xserver to implement the changes.
Opencv 2.3 on Ubuntu 9.10
The ubuntu 9.10 is not supported by ubuntu community any more. To use apt-get,
you have to manually edit "/etc/source.list" file and replace "archive" with "old-release".
The Opencv 2.3 need a cmake 2.8, buth ubuntu 9.10 only has cmake 2.6, so when you compile the opencv 2.3 the cmake gives you errors and warnings such as "incompletely configuration".
What you need to do is downlad cmake 2.8 and install it.
you have to manually edit "/etc/source.list" file and replace "archive" with "old-release".
The Opencv 2.3 need a cmake 2.8, buth ubuntu 9.10 only has cmake 2.6, so when you compile the opencv 2.3 the cmake gives you errors and warnings such as "incompletely configuration".
What you need to do is downlad cmake 2.8 and install it.
Wednesday, December 14, 2011
URG-04LX-UG01 problems and solutions
Recently our group got a urg laser which has a usb connector. It took me about two days to figure following problems out:
1. Power. The laser comes with a dual usb connector. From the urg website, it says the urg needs two usb port to get enough power (>500mA). I have tried every pairs of usb port. Neither of them work. The possible reasons are: the laser is damaged, the cable doesn't work, or the power from pc usb is not enough. I simply use a single usb connector from my mp3 to replace the dual usb port, then the laser is surprisingly working!! What can I say. Dual port don't work, single port works fine! If you have similar problem, then you can try this solution.
2. Library. Now the laser can work well with XP system after installing the driver. However, the library got some problems when I compile them, such as can no reference to 'floor'. I google the solutions and find one nice patched urg library which works fine for Ubuntu oneiric: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/urg/oneiric/revision/4?start_revid=4 You can download the tarball of the urg library and compile it. That works great on my ubuntu machine.
3. Urg program samples. The sample programs also get some problems, such as "undefined reference to" blabla. The solution is very simple: rewriting the Make file (for C++ urg_sample) as : CXXFLAGS = -g `urg-config --cflags` `sdl-config --cflags` LDFLAGS = `urg-config --libs` `sdl-config --libs` LDLIBS = -lc gdScanSample: gdScanSample.cpp g++ -o gdScanSample gdScanSample.cpp $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) clean : $(RM) *.o $(TARGET) .PHONY : all clean
Now, everything works perfectly. Enjoy!
1. Power. The laser comes with a dual usb connector. From the urg website, it says the urg needs two usb port to get enough power (>500mA). I have tried every pairs of usb port. Neither of them work. The possible reasons are: the laser is damaged, the cable doesn't work, or the power from pc usb is not enough. I simply use a single usb connector from my mp3 to replace the dual usb port, then the laser is surprisingly working!! What can I say. Dual port don't work, single port works fine! If you have similar problem, then you can try this solution.
2. Library. Now the laser can work well with XP system after installing the driver. However, the library got some problems when I compile them, such as can no reference to 'floor'. I google the solutions and find one nice patched urg library which works fine for Ubuntu oneiric: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/urg/oneiric/revision/4?start_revid=4 You can download the tarball of the urg library and compile it. That works great on my ubuntu machine.
3. Urg program samples. The sample programs also get some problems, such as "undefined reference to" blabla. The solution is very simple: rewriting the Make file (for C++ urg_sample) as : CXXFLAGS = -g `urg-config --cflags` `sdl-config --cflags` LDFLAGS = `urg-config --libs` `sdl-config --libs` LDLIBS = -lc gdScanSample: gdScanSample.cpp g++ -o gdScanSample gdScanSample.cpp $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) clean : $(RM) *.o $(TARGET) .PHONY : all clean
Now, everything works perfectly. Enjoy!
Wednesday, September 21, 2011
Google, what are you going to do with the blogger?
Now the google has the google+. How about the Blogger?
It's even harder to access the Blogger from the homepage of the Google.
I couldn't find it. The only thing about the blog is the blog search which is useless for me, because I don't want to search my blogger which is ridiculous.
The only way left is to type the www.blogger.com instead of the www.google.com.
Friday, August 19, 2011
Saturday, August 13, 2011
IEEE LATEX TEMPLATE \markboth doesn't work
Because the default setting of the template is one side document, so to enable the \markboth,
you have to add twoside to the documentclass options:
\documentclass[10pt,journal,letterpaper,compsoc,twoside]{IEEEtran}
you have to add twoside to the documentclass options:
\documentclass[10pt,journal,letterpaper,compsoc,twoside]{IEEEtran}
Friday, August 12, 2011
cvFloodFill: one example
In the OpenCv, the definition of cvFloodFill is:
void cvFloodFill( CvArr* img, CvPoint seed, double newVal,
double lo=0, double up=0, CvConnectedComp* comp=0,
int flags=4, CvArr* mask=0 );
#define CV_FLOODFILL_FIXED_RANGE (1 << 16)
#define CV_FLOODFILL_MASK_ONLY (1 << 17)
The trick is how to define the flags. One example is:
int flags = connectivity + (new_mask_val << 8 ) + CV_FLOODFILL_FIXED_MASK_ONLY;
where connectivity can be 4 or 8, new_mask_val is the gray value to be assigned to the mask, e.g., 255.
void cvFloodFill( CvArr* img, CvPoint seed, double newVal,
double lo=0, double up=0, CvConnectedComp* comp=0,
int flags=4, CvArr* mask=0 );
#define CV_FLOODFILL_FIXED_RANGE (1 << 16)
#define CV_FLOODFILL_MASK_ONLY (1 << 17)
The trick is how to define the flags. One example is:
int flags = connectivity + (new_mask_val << 8 ) + CV_FLOODFILL_FIXED_MASK_ONLY;
where connectivity can be 4 or 8, new_mask_val is the gray value to be assigned to the mask, e.g., 255.
Subscribe to:
Posts (Atom)