_gcgraph.diff

Bug fix - Sergey Popov, 2011-05-23 01:53 pm

Download (651 Bytes)

 
modules/imgproc/src/gcgraph.hpp (working copy)
97 97
void GCGraph<TWeight>::create( unsigned int vtxCount, unsigned int edgeCount )
98 98
{
99 99
    vtcs.reserve( vtxCount );
100
    edges.reserve( edgeCount );
100
    edges.reserve( edgeCount + 2 );
101 101
    flow = 0;
102 102
}
103 103

  
......
118 118
    CV_Assert( w>=0 && revw>=0 );
119 119
    CV_Assert( i != j );
120 120

  
121
    if( !edges.size() )
122
        edges.resize( 2 );
123

  
121 124
    Edge fromI, toI;
122 125
    fromI.dst = j;
123 126
    fromI.next = vtcs[i].first;