Category Archives: Techniques

装了fedora7

每次装系统的时候就会碰到不同的问题,这次就是vnc的port始终打不开,搞了很长时间,现在终于好了。

对vnc,要配置下面三个地方,
1 /etc/sysconfig/vncservers,添加用户名,然后叫用vncpasswd添加密码
2 在当前用户下运行./vncservers,在产生的.vnc目录里修改xstartup文件;
3 修改/etc/sysconfig/iptables,添加5901 prot#,restart iptables, /sbin/service iptables restart
4 然后运行vncserver, 一些命令vncserver -kill :1, killall Xvc.

Find more equations

看了一些paper,发现它们都有一个共同点。对于一个问题,比如你要解2个未知数,但是你只有一个equation,这该如何解呢?

这些paper第一步都是find more eqations。比如Lucas-Kanade的算法求optical flow,他assume一个5×5的窗口内的pixel具有相同的flow,这样一个equation就变成了25个,问题就可解了。再如,matting,7个未知数但是只有3个equations,但是它找两个known的pattern做为background,这样就有6个equations来解4个未知数。类似的还有flash-nonflash等等。

IPP+OPENCV

Add the following code,

const char* opencv_libraries = 0;
const char* addon_modules = 0;
cvGetModuleInfo( 0, &opencv_libraries, &addon_modules );
printf( “OpenCV: %s\nAdd-on Modules: %s\n”, opencv_libraries, addon_modules );

When IPP is detected, it will print something like this:
OpenCV: cxcore: beta 4.1 (0.9.7), cv: beta 4.1 (0.9.7)
Add-on modules: ippcv20.dll, ippi20.dll, ipps20.dll, ippvm20.dll

Then the IPP version of the function will be loaded automatically.
http://www.intel.com/support/performancetools/libraries/ipp/sb/cs-010656.htm
Learning-Based Computer Vision with Intel’s Open Source Computer Vision Library
http://www.intel.com/technology/itj/2005/volume09issue02/art03_learning_vision/p01_abstract.htm

How to turn off IPP? And turn on it again?
cvUseOptimized(0); …cvUseOptimized(1);

用了这么多年opencv和ipp了,还不清楚opencv原来可以自动调用ipp的函数。。。

Fast Fourier Transform

一个不错的FFT library,http://www.fftw.org/

最近在看bilateral filtering的文章,其中一篇就是将怎么将bf这个非线性卷积转换成一个3维空间里的线性卷积和一个非线性运算(转换成线性卷积有一个好处就是可以使用FFT来加速。)这跟以前做模式分类有点像(比如svm),在低维空间线性不可分,变换到高维空间就线性可分了。

slit camera

http://spitbite.org/pinhole-discussion/2005/0502/0089.html

“I used two opposed straight razor blades separated by about a .010″ gap to make each slit, then set the front and back slits about 20mm apart. I also did freehand cutting a curving cut into a piece of .005″ brass with a utility knife of a surface of scrap wood, backed it with cardboard set back about 1mm from the edge and then separated by about .010”. The cutting produced a slightly uneven edge that produces banding artefacts in the image (as does a commercial razor). See WWPD 2002 gallery http://www.pinholeday.org/gallery/2002/index.php?gc=y image number 338.
Here I cite the legendary Rudolf Kingslake from his classic “Optics in Photography” (SPIE 1992, from his “Lenses in Photography” 1951 and 1963) in Chapter 3, page 64…
The Crossed-Slit Anamorphoser (following his section on The Pinhole Camera) – An interesting device, credited to Ducos du Hauron, is the crossed-slit anamorphoser. This is a modified pinhole camera in which the pinhole has been replaced by a pair of narrow, perpendicularly crossed slits spaced apart along the camera axis (Fig. 3.3). The horizontal scale of the picture is obviously determined by fh [distance from horizontal slit to film plane], which is the distance from the vertical slit to the film, but the vertical scale is defined by the distance fv [distance from vertical slit to film plane] of the film from the horizontal slit. The pair of slits working together thus constitutes a pinhole camera in which the image is stretched or compressed in one direction more than in the other. This type of distortion is called “anamorphic” or “anamorphotic” and the degree of anamorphic compression can obviously be varied over a wide range by merely changing the separation of the slits or by moving the pair of slits closer to or further from the film plane. [This guy also patented the anaglyph in 1891.]
See Ducos du Haruon’s image here (third image thumbnail down): http://www.geh.org/taschen/htmlsrc4/
See also Nick Dvoracek’s kind hosting of an article from Scientific American, “The Slit Camera, February 15, 1916. Report on the slit camera and how images are changed by using a slit instead of a pinhole.” here (which credits a Wolfgang Otto for the device): http://idea.uwosh.edu/nick/SciAm.pdf (Thanks, Nick, for those fabulous publications in .pdf format!) This give you great illustrations what that the thing looks like, makes it very easy to understand).
Slit is fun stuff, and requires little more than an SLR body, cardboard tubes, black electricians tape and some creativity.
Regards,
Michael San Jose “

正交函数基

最近做image warping,把image从一个camera warp到另外一个camera。最开始用了homography的方法,不好用;又试了一下使用depth map和camera calibration,但是因为depth map不精确,加上estimated的focal length也不精确,所以这种方法也不行;也试了使用函数warping的方法,使用1, x, x^2, x^3, …函数基,也不行。现在准备试一试正交的函数基。

http://en.wikipedia.org/wiki/Basis_function

Polynomial bases

The collection of quadratic polynomials with real coefficients has {1, t, t²} as a basis. Every quadratic can be written as a1+bt+ct², that is, as a linear combination of the basis functions 1, t, and t². The set {(1/2)(t-1)(t-2), –t(t-2), (1/2)t(t-1)} is another basis for quadratic polynomials, called the Lagrange basis.

http://en.wikipedia.org/wiki/Lagrange_polynomial

Orthogonal polynomials

http://en.wikipedia.org/wiki/Orthogonal_polynomials

Legendre polynomials

http://en.wikipedia.org/wiki/Legendre_polynomials