Merge pull request #18488 from alalek:maxflow_missing_check

This commit is contained in:
Alexander Alekhin 2020-10-02 15:04:28 +00:00
commit a5b8f163d7

View File

@ -152,6 +152,8 @@ void GCGraph<TWeight>::addTermWeights( int i, TWeight sourceW, TWeight sinkW )
template <class TWeight>
TWeight GCGraph<TWeight>::maxFlow()
{
CV_Assert(!vtcs.empty());
CV_Assert(!edges.empty());
const int TERMINAL = -1, ORPHAN = -2;
Vtx stub, *nilNode = &stub, *first = nilNode, *last = nilNode;
int curr_ts = 0;