Monthly Archives: October 2007

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来解问题,这篇比较关键;




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第一步都是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等等。


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.
Learning-Based Computer Vision with Intel’s Open Source Computer Vision Library

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


Fast Fourier Transform

一个不错的FFT library,

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

slit camera

“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 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):
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): (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.
Michael San Jose “