**************************************************
* MRF energy minimization software *
* Version 2.1 *
* March 18, 2007 *
**************************************************
* Changes since version 2.0:
* added code to count GC truncations (see energy.h)
This directory contains the MRF energy minimization software accompanying
the paper
[1] A Comparative Study of Energy Minimization Methods for Markov
Random Fields.
R. Szeliski, R. Zabih, D. Scharstein, O. Veksler, V. Kolmogorov,
A. Agarwala, M. Tappen, and C. Rother.
In Ninth European Conference on Computer Vision (ECCV 2006),
volume 2, pages 16-29, Graz, Austria, May 2006.
Optimization methods included:
1) ICM
2) Graph Cuts
3) Max-Product Belief Propagation
4) Sequential tree-reweighted message passing (TRW-S)
Instructions for compiling and using the software are included below.
CREDITS:
* MRF code, graph cut interface, and example code by Olga Veksler
* Graph cut library by Yuri Boykov and Vladimir Kolmogorov
* Belief propagation code by Marshall Tappen
* TRW-S by Vladimir Kolmogorov
=========================== INSTRUCTIONS FOR CITATIONS ========================
If you use this software, you should cite the paper [1]. In addition,
since this software builds on the algorithms and libraries developed by
many different people, you should also follow the instructions about proper
citing below.
(a) If you use the GraphCuts optimization (written by Olga Veksler, using
the libraries provided by Yuri Boykov and Vladimir Kolmogorov), you
should cite the following papers:
[2] Fast Approximate Energy Minimization via Graph Cuts.
Y. Boykov, O. Veksler, and R. Zabih.
In IEEE Transactions on Pattern Analysis and Machine Intelligence
(PAMI), vol. 23, no. 11, pages 1222-1239, November 2001.
[3] What Energy Functions can be Minimized via Graph Cuts?
V. Kolmogorov and R. Zabih.
In IEEE Transactions on Pattern Analysis and Machine Intelligence
(PAMI), vol. 26, no. 2, pages 147-159, February 2004.
An earlier version appeared in European Conference on Computer
Vision (ECCV), May 2002.
[4] An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
Energy Minimization in Vision.
Y. Boykov and Vladimir Kolmogorov.
In IEEE Transactions on Pattern Analysis and Machine Intelligence
(PAMI), vol. 26, no. 9, pages 1124-1137, September 2004.
The graph-cuts software can be used only for research purposes. If you
wish to use the graph-cuts software for commercial purposes, you should
be aware that there is a US patent:
R. Zabih, Y. Boykov, O. Veksler.
"System and method for fast approximate energy minimization via
graph cuts",
United Stated Patent 6,744,923, June 1, 2004.
Citation [2] develops the graph-cuts algorithms (alpha-expansion and
the swap algorithms), citation [3] gives a simpler graph construction
for the methods described in [2], and citation [4] gives an efficient
min-cut/max-flow algorithm for computing the minimum graph cut.
The file energy.h included here is a slight modification of the file
energy.h in energy-v1.1.src by Vladimir Kolmogorov, available at
http://www.adastral.ucl.ac.uk/~vladkolm/software.html
The files block.h, graph.cpp, graph.h, and maxflow.cpp included here
are slight modifications of the files in maxflow-v2.2.src/forward_star,
by Vladimir Kolmogorov and Yuri Boykov, available at
http://www.adastral.ucl.ac.uk/~vladkolm/software.html
(b) If you are using the Belief Propagation software (provided by Marshall
Tappen), you should cite
[5] M. F. Tappen and W. T. Freeman.
Comparison of Graph Cuts with Belief Propagation for Stereo, using
Identical MRF Parameters.
In Proceedings of the Ninth IEEE International Conference on
Computer Vision (ICCV), pages 900-907, 2003
(c) If you are using the TRW-S software (provided by Vladimir Kolmogorov),
you should cite
[6] M. J. Wainwright, T. S. Jaakkola and A. S. Willsky.
MAP estimation via agreement on trees: Message-passing and
linear-programming approaches.
In IEEE Transactions on Information Theory, vol. 51, no. 11, pages
3697--3717, November 2005.
[7] V. Kolmogorov.
Convergent Tree-reweighted Message Passing for Energy Minimization.
In IEEE Transactions on Pattern Analysis and Machine Intelligence
(PAMI), vol. 28, no. 10, October 2006.
============================= INSTRUCTIONS FOR USAGE ==========================
A simple Makefile is included - typing "make" will compile the library and
a sample driver file "example.cpp" into an executable "example".
Here is a brief description of how to use the code; see also example.cpp
and mrf.h.
The default type for energy is int. If you want to change this type to
other numerical type, such as float, double, etc., in mrf.h, change the
following 2 lines to the desired type:
typedef int EnergyVal; /* The total energy of a labeling */
typedef int CostVal; /* costs of individual terms of the energy */
Note that CostVal is the type of individual energy terms (such as the data
cost for pixel p and label l), and EnergyVal is the type for the total
energy value. Therefore, the sum of all individual energy terms should not
"overflow" the EnergyVal type.
Step 1: Set up an energy function
An energy function is specified by setting data costs and smoothness
costs. Data costs and smoothness costs can be specified by an array or
function. In addition, smoothness cost can be specified by parameters
lambda, k, V_max, as explained in section 2 of paper [1], in which case
the smoothness cost V(|l1-l2|) = lambda*min(V_max,|l1-l2|^k). Spatially
varying per-pairing weights w_pq can be also specified.
(a) Setting up Data Terms
There are 2 ways to set up data terms:
(i) you can allocate an array dCost of size (numberofPixels)*(numberofLabels) of the CostVal type,
where dCost[pix*numberofLabels + l] is the cost of assigning label l to pixel pix
(ii) or you can set up a function
MRF::CostVal dCost(int pix, int i), which takes pixel pix and label i and returns the data cost
After you initialized data cost array, or setup a function data cost, to initialize data cost
for optimization, call:
DataCost *data = new DataCost(dCost);
(b) Setting up Smoothness Terms
There are 3 ways to set up smoothness terms:
(i) Set up a symmetric array smooth of size numberofLabels*numberofLabels,
where V(l1,l2) = smooth[l1+numberofLabels*l2] = smooth[l2+numberofLabels*l1]
(ii) Specify V_max and k
(iii) The most general way is to set up afunction
MRF::CostVal fnCost(int pix1, int pix2, int i, int j) which takes pixels pix1 and pix2,
labels i and j and returns the smoothness penalty V for assigning labels i to pix1 and j to pix2.
In addition, if you used (i) or (ii) to specify the smoothness penalty V, and if the neighborhood system
is the standard 4 connected grid, you can specify the spacial varying weights w_pq in arrays vCue, hCue,
each of which has size width*height, where width is the width of the grid and height is the height of
the set of the grid. hCue[x+y*width] holds the variable weight for edge between pixels (x+1,y) and (x,y)
and vCue[x+y*width] holds the variable weight for edge between pixels (x,y+1) and (x,y)
After you've done steps (i), or (ii), or (iii), to initialize smoothness cost
for optimization, call:
In case of (i) and NO spacially varying weights w_pq: SmoothnessCost *smooth = new SmoothnessCost(smooth)
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
MRF-benchmark (107个子文件)
libpng.a 165KB
libz.a 66KB
GCoptimization.cpp 44KB
maxflow.cpp 27KB
TRW-S.cpp 26KB
BP-S.cpp 25KB
ImageIO.cpp 19KB
regions-maxprod.cpp 18KB
seamFinder.cpp 15KB
mrfstereo.cpp 15KB
graph.cpp 12KB
example.cpp 10KB
Convolve.cpp 9KB
ImageIOpng.cpp 9KB
ICM.cpp 8KB
MaxProdBP.cpp 8KB
pngio.cpp 7KB
binary.cpp 7KB
Convert.cpp 6KB
XGetopt.cpp 6KB
denoise.cpp 6KB
Image.cpp 5KB
familySeamFinder.cpp 4KB
runalgs.cpp 3KB
image.cpp 3KB
mrf.cpp 3KB
RefCntMem.cpp 2KB
familyComposite.cpp 2KB
pano.cpp 2KB
LinkedBlockList.cpp 1KB
png.h 142KB
zlib.h 58KB
pngconf.h 44KB
GCoptimization.h 14KB
mrf.h 12KB
energy.h 11KB
zconf.h 9KB
graph.h 9KB
block.h 9KB
Image.h 8KB
Copyright.h 3KB
TRW-S.h 3KB
Convert.h 2KB
Convolve.h 2KB
BP-S.h 2KB
MaxProdBP.h 2KB
RefCntMem.h 2KB
image.h 2KB
LinkedBlockList.h 2KB
regions-new.h 2KB
ICM.h 1KB
ImageIO.h 1KB
seamFinder.h 1KB
Error.h 1001B
typeTruncatedQuadratic2D.h 896B
XGetopt.h 805B
coord.h 687B
runalgs.h 657B
familySeamFinder.h 635B
pngio.h 506B
globals.h 395B
includes.h 336B
imageLib.h 115B
libpng.lib 319KB
zlib.lib 93KB
Makefile 2KB
Makefile 2KB
Makefile 1KB
Makefile 1KB
Makefile 1KB
Makefile 922B
Makefile 721B
MRF 6B
small_DSC_0170.png 1018KB
small_DSC_0168.png 1017KB
small_DSC_0176.png 1017KB
small_DSC_0173.png 1014KB
small_DSC_0174.png 1014KB
NQIMG_0261.PNG 343KB
NQIMG_0264.PNG 330KB
NQIMG_0260.PNG 323KB
teddy-imR.png 316KB
teddy-imL.png 314KB
venus-imR.png 300KB
venus-imL.png 300KB
NQIMG_0263.PNG 289KB
NQIMG_0257.PNG 258KB
NQIMG_0259.PNG 256KB
NQIMG_0258.PNG 253KB
tsukuba-imL.png 171KB
tsukuba-imR.png 170KB
house-input.png 41KB
teddy-truedispL.png 27KB
penguin-input.png 18KB
familydatacost.png 7KB
venus-truedispL.png 6KB
tsukuba-truedispL.png 3KB
house-mask.png 613B
penguin-mask.png 606B
sponge.txt 5.39MB
共 107 条
- 1
- 2
zhengyujie_
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1