GrabCut

所属分类:图形图像处理
开发工具:Visual C++
文件大小:10553KB
下载次数:959
上传日期:2008-01-12 15:44:53
上 传 者henry1987
说明:  GrabCut图像分割算法,用迭代图像切割法完成交互式前景提取.
(GrabCut image segmentation algorithm, using iterative image-cut method to complete the interactive extraction prospects.)

文件列表:
GrabCut\beach.ppm (180045, 2007-12-22)
GrabCut\carsten.ppm (1440045, 2007-12-23)
GrabCut\chenwenfei.ppm (61140, 2007-12-24)
GrabCut\Color.cpp (6246, 2007-12-24)
GrabCut\Color.h (957, 2007-12-22)
GrabCut\Debug\beach.ppm (180045, 2007-12-22)
GrabCut\Debug\carsten.ppm (1440045, 2007-12-23)
GrabCut\Debug\Color.obj (312929, 2008-01-05)
GrabCut\Debug\Color.sbr (0, 2008-01-05)
GrabCut\Debug\GMM.obj (39494, 2008-01-05)
GrabCut\Debug\GMM.sbr (0, 2008-01-05)
GrabCut\Debug\GrabCut.bsc (648192, 2008-01-05)
GrabCut\Debug\GrabCut.exe (557128, 2008-01-05)
GrabCut\Debug\GrabCut.ilk (888960, 2008-01-05)
GrabCut\Debug\GrabCut.obj (77719, 2008-01-05)
GrabCut\Debug\GrabCut.pdb (1467392, 2008-01-05)
GrabCut\Debug\GrabCut.sbr (0, 2008-01-05)
GrabCut\Debug\graph.obj (15037, 2008-01-05)
GrabCut\Debug\graph.sbr (0, 2008-01-05)
GrabCut\Debug\Image.obj (10629, 2008-01-05)
GrabCut\Debug\Image.sbr (0, 2008-01-05)
GrabCut\Debug\llama.ppm (571014, 2007-12-23)
GrabCut\Debug\main.obj (38759, 2008-01-05)
GrabCut\Debug\main.sbr (0, 2008-01-05)
GrabCut\Debug\maxflow.obj (20080, 2008-01-05)
GrabCut\Debug\maxflow.sbr (0, 2008-01-05)
GrabCut\Debug\vc60.idb (132096, 2008-01-05)
GrabCut\Debug\vc60.pdb (151552, 2008-01-05)
GrabCut\Examples\carsten.bmp (1440054, 2004-02-29)
GrabCut\Examples\carsten_comp.jpg (41066, 2004-08-26)
GrabCut\Examples\carsten_cut.png (202307, 2004-08-26)
GrabCut\Examples\carsten_rec.jpg (88158, 2004-08-26)
GrabCut\Examples\child.JPG (351418, 2003-09-06)
GrabCut\Examples\child_comp.jpg (137726, 2004-08-26)
GrabCut\Examples\child_cut.png (798744, 2004-08-26)
GrabCut\Examples\child_rec.jpg (80064, 2004-08-26)
GrabCut\Examples\collage1.jpg (201514, 2004-08-26)
GrabCut\Examples\collage2.jpg (111714, 2004-08-26)
GrabCut\Examples\crocket.jpg (591982, 2004-06-23)
GrabCut\Examples\crocket_comp.jpg (128887, 2004-08-26)
... ...

################################################################### # # # MAXFLOW - software for computing mincut/maxflow in a graph # # Version 2.02 # # http://www.cs.cornell.edu/People/vnk/software.html # # # # Vladimir N. Kolmogorov # # vnk@cs.cornell.edu 2001 # # # ################################################################### 1. Introduction. This software library is a modification of the maxflow algorithm described in An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Computer Vision. Yuri Boykov and Vladimir Kolmogorov. In Third International Workshop on Energy Minimization Methods in Computer Vision and Pattern Recognition, September 2001 This algorithm was originally developed at Siemens. The main modification is that two trees are used for finding augmenting paths - one grows from the source and the other from the sink. (The original algorithm used only the former one). Details will be described in my PhD thesis. It can be used only for research purposes. IF YOU USE THIS SOFTWARE, YOU SHOULD CITE THE AFOREMENTIONED PAPER IN ANY RESULTING PUBLICATION. Tested under windows, Visual C++ 6.0 compiler and unix (SunOS 5.8 and RedHat Linux 7.0, GNU c++ compiler). ################################################################## 2. Graph representation. There are two versions of the algorithm using different graph representations (adjacency list and forward star). The former one uses more than twice as much memory as the latter one but is 10-20% faster. Memory allocation (assuming that all capacities are 'short' - 2 bytes): | Nodes | Arcs ------------------------------------------ Adjacency list | *24 bytes | *14 bytes Forward star | *28 bytes | 6 bytes (* means that often it should be rounded up to be a multiple of 4 - some compilers (e.g. Visual C++) seem to round up elements of arrays unless the are structures containing only char[].) Note that arcs are always added in pairs - in forward and reverse directions. Arcs between nodes and terminals (the source and the sink) are not stored as arcs, but rather as a part of nodes. The assumption for the forward star representation is that the maximum number of arcs per node (except the source and the sink) is much less than ARC_BLOCK_SIZE (1024 by default). Both versions have the same interface. ################################################################## 3. Example usage. This section shows how to use the library to compute a minimum cut on the following graph: SOURCE / \ 1/ \2 / 3 \ node0 -----> node1 | <----- | | 4 | \ / 5\ /6 \ / SINK /////////////////////////////////////////////////// #include #include "graph.h" void main() { Graph::node_id nodes[2]; Graph *g = new Graph(); nodes[0] = g -> add_node(); nodes[1] = g -> add_node(); g -> set_tweights(nodes[0], 1, 5); g -> set_tweights(nodes[1], 2, 6); g -> add_edge(nodes[0], nodes[1], 3, 4); Graph::flowtype flow = g -> maxflow(); printf("Flow = %d\n", flow); printf("Minimum cut:\n"); if (g->what_segment(nodes[0]) == Graph::SOURCE) printf("node0 is in the SOURCE set\n"); else printf("node0 is in the SINK set\n"); if (g->what_segment(nodes[1]) == Graph::SOURCE) printf("node1 is in the SOURCE set\n"); else printf("node1 is in the SINK set\n"); delete g; } ///////////////////////////////////////////////////

近期下载者

相关文件


收藏者