diff --git a/samples/cpp/stitching.cpp b/samples/cpp/stitching.cpp index c577dd200..ab087c522 100644 --- a/samples/cpp/stitching.cpp +++ b/samples/cpp/stitching.cpp @@ -40,14 +40,6 @@ // //M*/ -// We follow to these papers: -// 1) Construction of panoramic mosaics with global and local alignment. -// Heung-Yeung Shum and Richard Szeliski. 2000. -// 2) Eliminating Ghosting and Exposure Artifacts in Image Mosaics. -// Matthew Uyttendaele, Ashley Eden and Richard Szeliski. 2001. -// 3) Automatic Panoramic Image Stitching using Invariant Features. -// Matthew Brown and David G. Lowe. 2007. - #include #include #include "opencv2/highgui/highgui.hpp" @@ -56,6 +48,33 @@ using namespace std; using namespace cv; +bool try_use_gpu = false; +vector imgs; +string result_name = "result.jpg"; + +void printUsage(); +int parseCmdArgs(int argc, char** argv); + +int main(int argc, char* argv[]) +{ + int retval = parseCmdArgs(argc, argv); + if (retval) return -1; + + Mat pano; + Stitcher stitcher = Stitcher::createDefault(try_use_gpu); + Stitcher::Status status = stitcher.stitch(imgs, pano); + + if (status != Stitcher::OK) + { + cout << "Can't stitch images, error code = " << status << endl; + return -1; + } + + imwrite(result_name, pano); + return 0; +} + + void printUsage() { cout << @@ -69,9 +88,6 @@ void printUsage() " The default is 'result.jpg'.\n"; } -bool try_use_gpu = false; -vector imgs; -string result_name = "result.jpg"; int parseCmdArgs(int argc, char** argv) { @@ -120,23 +136,3 @@ int parseCmdArgs(int argc, char** argv) } -int main(int argc, char* argv[]) -{ - int retval = parseCmdArgs(argc, argv); - if (retval) return -1; - - Mat pano; - Stitcher stitcher = Stitcher::createDefault(try_use_gpu); - Stitcher::Status status = stitcher.stitch(imgs, pano); - - if (status != Stitcher::OK) - { - cout << "Can't stitch images, error code = " << status << endl; - return -1; - } - - imwrite(result_name, pano); - return 0; -} - - diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp index 15d82db7f..ee5650102 100644 --- a/samples/cpp/stitching_detailed.cpp +++ b/samples/cpp/stitching_detailed.cpp @@ -40,14 +40,6 @@ // //M*/ -// We follow to these papers: -// 1) Construction of panoramic mosaics with global and local alignment. -// Heung-Yeung Shum and Richard Szeliski. 2000. -// 2) Eliminating Ghosting and Exposure Artifacts in Image Mosaics. -// Matthew Uyttendaele, Ashley Eden and Richard Szeliski. 2001. -// 3) Automatic Panoramic Image Stitching using Invariant Features. -// Matthew Brown and David G. Lowe. 2007. - #include #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/detail/autocalib.hpp"