fixed error in gcgraph which led to problems in opencv_stitching GC seam finder, added check for duplication in matches (opencv_stitching)

This commit is contained in:
Alexey Spizhevoy
2011-06-02 12:13:06 +00:00
parent 1a0b1d2aea
commit 4401f33e10
4 changed files with 433 additions and 409 deletions

View File

@@ -97,7 +97,7 @@ template <class TWeight>
void GCGraph<TWeight>::create( unsigned int vtxCount, unsigned int edgeCount )
{
vtcs.reserve( vtxCount );
edges.reserve( edgeCount );
edges.reserve( edgeCount + 2 );
flow = 0;
}
@@ -118,6 +118,9 @@ void GCGraph<TWeight>::addEdges( int i, int j, TWeight w, TWeight revw )
CV_Assert( w>=0 && revw>=0 );
CV_Assert( i != j );
if( !edges.size() )
edges.resize( 2 );
Edge fromI, toI;
fromI.dst = j;
fromI.next = vtcs[i].first;