Friday, August 19, 2011

such that vs. so that

so that focuses on a purpose.

such that focuses on a consequence.

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}

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.

Wednesday, August 10, 2011

JAVACV: no jniopencv_core in java.library.path

To solve it, adding following lines to ~/.bashrc:
#For JavaCv
export CLASSPATH=$CLASSPATH:~/Src/javacv/javacv-bin/javacpp.jar:~/Src/javacv/javacv-bin/javacv.jar:~/Src/javacv/javacv-bin/javacv-linux-x86.jar

The key solution is the javacv-linux-x86.jar. If you are using 64bits windows, then you have to choose javacv-windows-x86_64.jar.

Tuesday, August 9, 2011

Read temperature from sensors in GPU

The powerful tool is xsensors:
First install lm-sensors:
$ sudo apt-get install lm-sensors
Then run sensors-detect in root
$ sudo sensors-detect
Answer YES to all.
Then run sudo /etc/init.d/module-init-tools restart
Answer No.
Next install xsensors and run it by:
$ sudo apt-get install xsensors
$ sudo xsensors

Recover the default nvidia driver

Just do:
$ sudo apt-get install nvidia-current
That's it.