图割论文大合集下载:

http://download.csdn.net/detail/wangyaninglm/8292305

代码:

/* graph.h */
/* Vladimir Kolmogorov (vnk@cs.cornell.edu), 2001. */ /*
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. This implementation uses an adjacency list graph representation.邻接链表
Memory allocation:
Nodes: 22 bytes + one field to hold a residual capacity
of t-links (by default it is 'short' - 2 bytes)
Arcs: 12 bytes + one field to hold a residual capacity 剩余容量
(by default it is 'short' - 2 bytes)
(Note that arcs are always added in pairs (弧都是成对的添加)- in forward and reverse directions) Example usage (computes a maxflow on the following graph): SOURCE
/ \
1/ \2
/ 3 \
node0 -----> node1
| <----- |
| 4 |
\ /
5\ /6
\ /
SINK /////////////////////////////////////////////////// #include <stdio.h>
#include "graph.h" void test_maxflow()
{
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;
} ///////////////////////////////////////////////////
*/

void test_maxflow()
{
Graph::node_id nodes[2];
Graph *g = new Graph(); nodes[0] = g -> add_node();
nodes[1] = g -> add_node();
g -> set_tweights(nodes[0], 3, 3);
g -> set_tweights(nodes[1], 3, 1);
g -> add_edge(nodes[0], nodes[1], 1, 0); 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;
}

这块主要就是要理解,什么是maxflow,以及节点最后分割的类型是SOURCE还是SINK分别意味着什么

graphcuts算法时间复杂度与其他最大流算法的比较:

添加几篇文章地址:

graphcuts资料博客大合集

http://vision.csd.uwo.ca/code/

http://lincccc.blogspot.tw/2011/04/graph-cut-and-its-application-in.html

http://blog.csdn.net/zouxy09/article/details/8532106

http://lincccc.blogspot.tw/2011/03/cuda-cuts-fast-graph-cuts-on-gpu_03.html

http://blog.csdn.net/hebby06/article/details/5341228

最新文章

  1. Ubuntu学习总结-09 安装 Pycharm
  2. Mysql错误:Ignoring query to other database解决方法
  3. [转] 《ES6标准入门》读书笔记
  4. 论文第5章:Android绘图平台的实现
  5. React Native实践之携程Moles框架
  6. Uvision5不能进行软件仿真
  7. iOS多线程的初步研究(九)-- dispatch源
  8. [__NSCFNumber length]: unrecognized selector sent to instance 0x8b3c310
  9. ios fix UIRefreshControl bug
  10. mac 生成支付宝的rsa公钥和私钥 php版本
  11. 4.I/O复用以及基于I/O复用的回射客户端/服务器
  12. Git:warning: LF will be replaced by CRLF
  13. [三]java8 函数式编程Stream 概念深入理解 Stream 运行原理 Stream设计思路
  14. 想起以前写的一个爬虫,然后就用C#WinForm写了一个下载小说的软件,比较简单
  15. 洛谷P2468 SDOI 2010 粟粟的书架
  16. Ubuntu关闭(重启)网络服务命令
  17. Img与background的区别
  18. 如何使用V7包中ActionBar(Eclipse版)
  19. HDU 5321 Beautiful Set
  20. 《Sqlserver》通过端口 8080 连接到主机 localhost 的 TCP/IP 连接失败。错误:“驱动程序收到意外的登录前响应。请验证连接属性,并检查 SQL Server 的实例正在主机上运行,且在此端口接受

热门文章

  1. ExtJS学习(二)Ext组件模型
  2. 3.QT中QCommandLineParser和QCommandLineOption解析命令行参数
  3. 【OpenGL】理解一些基本问题
  4. 如何判断webview是不是滑到底部
  5. linux的wc -l 命令统计文件少一行(一般是windows文件)
  6. java设计模式---三种工厂模式
  7. 面试常用算法总结——排序算法(java版)
  8. ROS_Kinetic_03 ROS入门向导
  9. bash:chkconfig:command not found
  10. javascript语法之函数的定义