简体   繁体   English

什么算法opencv GCGRAPH(最大流量)基于?

[英]What algorithm opencv GCGRAPH (max flow) is based on?

opencv has an implementation of max-flow algorithm (class GCGRAPH in file gcgraph.hpp). OpenCV的最大流算法的实现(类GCGRAPH文件gcgraph.hpp)。 It's available here . 可以在这里找到

Does anyone know which particular max-flow algorithm is implemented by this class? 有谁知道这个类实现了哪种特定的max-flow算法?

I am not 100% confident about this, but I believe that the algorithm is based on this research paper describing max-flow algorithms for computer vision . 我对此并不是100%有信心,但我相信该算法是基于这篇描述计算机视觉最大流算法的研究论文 Specifically, Section 3 describes a new algorithm for computing maximum flows. 具体而言,第3节描述了一种用于计算最大流量的新算法。

I haven't lined up every detail of the paper's algorithm with the implementation of the algorithm, but many details seem to match: 我没有通过算法的实现排列论文算法的每个细节,但许多细节似乎匹配:

  • The algorithm described works by using a bidirectional search from both s and t, which the implementation is doing as well: for example, there's a comment reading // grow S & T search trees, find an edge connecting them . 所描述的算法通过使用来自s和t的双向搜索来工作,实现也在这样做:例如,有一个注释读取// grow S & T search trees, find an edge connecting them
  • The algorithm described keeps track of a set of orphaned nodes, which the variable std::vector<Vtx*> orphans seems to track in the implementation. 所描述的算法跟踪一组孤立节点,变量std::vector<Vtx*> orphans似乎在实现中跟踪。
  • The algorithm described works by building up a set of trees and reusing them; 所描述的算法通过构建一组树并重用它们来工作; the algorithm implementation keeps track of a tree associated with each node. 算法实现跟踪与每个节点相关联的树。

I hope this helps! 我希望这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM