Monthly Archives: October 2007

Light Field Viewer

因为可能要做unstructured lumigraph之类的东西,最近又把light field看了一下,顺便也搜了一下相关的code,发现还真有,奇怪当时自己写light field的程序时为什么不先搜一下。

LightPack
http://graphics.stanford.edu/software/lightpack/
Light Field Viewer Software
http://msw3.stanford.edu/~pramanat/Software/LFViewerWeb/lfviewer.html

graph cut

Graph cut是一种energy minimization的方法,用来解first-order markov Random Field比用Belief Propagation感觉更好,比用dynamic programming(只用1D求解), gradient decedent, simulated annealing, etc 要好得更多;特别是使用a-b-swap, 和 a-expansion的时候。刚开始看graph cut的时候不着门道,走了很多弯路,现在总结起来可以这样学习:

1。学习algorithm课本里的关于graph那一节,或者google maxflow/mincut相关的内容,有介绍mincut的两种解法;
2。然后就开始看用graphcut解决computer vision里的问题,首先要看的是《Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D Images》iccv 01。这篇paper讲怎么用graphcut来做image segmentation;
3。看Fast Approximate Energy Minimization via Graph Cuts (Boykov, Veksler and Zabih, PAMI ’01),这篇paper系统介绍了如何构造graph和energy term来解stereo disparity, motion等问题,也比较直观的介绍了a-expansion。后面的关于graphcut的TPAMI的文章都没有介绍如何构造graph来解问题,这篇比较关键;

看了以上几个文章后,基本就可以看懂关于graphcut的论文了,就可以深入下去了。

装了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 “