Commit 4401f33e authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

fixed error in gcgraph which led to problems in opencv_stitching GC seam finder,…

fixed error in gcgraph which led to problems in opencv_stitching GC seam finder, added check for duplication in matches (opencv_stitching)
parent 1a0b1d2a
...@@ -97,7 +97,7 @@ template <class TWeight> ...@@ -97,7 +97,7 @@ template <class TWeight>
void GCGraph<TWeight>::create( unsigned int vtxCount, unsigned int edgeCount ) void GCGraph<TWeight>::create( unsigned int vtxCount, unsigned int edgeCount )
{ {
vtcs.reserve( vtxCount ); vtcs.reserve( vtxCount );
edges.reserve( edgeCount ); edges.reserve( edgeCount + 2 );
flow = 0; flow = 0;
} }
...@@ -118,6 +118,9 @@ void GCGraph<TWeight>::addEdges( int i, int j, TWeight w, TWeight revw ) ...@@ -118,6 +118,9 @@ void GCGraph<TWeight>::addEdges( int i, int j, TWeight w, TWeight revw )
CV_Assert( w>=0 && revw>=0 ); CV_Assert( w>=0 && revw>=0 );
CV_Assert( i != j ); CV_Assert( i != j );
if( !edges.size() )
edges.resize( 2 );
Edge fromI, toI; Edge fromI, toI;
fromI.dst = j; fromI.dst = j;
fromI.next = vtcs[i].first; fromI.next = vtcs[i].first;
......
...@@ -71,7 +71,7 @@ void printUsage() ...@@ -71,7 +71,7 @@ void printUsage()
" --try_gpu (yes|no)\n" " --try_gpu (yes|no)\n"
" Try to use GPU. The default value is 'no'. All default values\n" " Try to use GPU. The default value is 'no'. All default values\n"
" are for CPU mode.\n" " are for CPU mode.\n"
"\nMotion Estimation:\n" "\nMotion Estimation Flags:\n"
" --work_megapix <float>\n" " --work_megapix <float>\n"
" Resolution for image registration step. The default is 0.6 Mpx.\n" " Resolution for image registration step. The default is 0.6 Mpx.\n"
" --match_conf <float>\n" " --match_conf <float>\n"
...@@ -83,7 +83,7 @@ void printUsage() ...@@ -83,7 +83,7 @@ void printUsage()
" Bundle adjustment cost function. The default is 'focal_ray'.\n" " Bundle adjustment cost function. The default is 'focal_ray'.\n"
" --wave_correct (no|yes)\n" " --wave_correct (no|yes)\n"
" Perform wave effect correction. The default is 'yes'.\n" " Perform wave effect correction. The default is 'yes'.\n"
"\nCompositing:\n" "\nCompositing Flags:\n"
" --warp (plane|cylindrical|spherical)\n" " --warp (plane|cylindrical|spherical)\n"
" Warp surface type. The default is 'spherical'.\n" " Warp surface type. The default is 'spherical'.\n"
" --seam_megapix <float>\n" " --seam_megapix <float>\n"
......
This diff is collapsed.
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include <set>
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp" #include "opencv2/core/internal.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment