Perf Tests: default stitching scenario.
authorAndrey Pavlenko <no@email>
Tue, 13 Sep 2011 11:19:40 +0000 (11:19 +0000)
committerAndrey Pavlenko <no@email>
Tue, 13 Sep 2011 11:19:40 +0000 (11:19 +0000)
modules/stitching/perf/perf_main.cpp [new file with mode: 0644]
modules/stitching/perf/perf_precomp.cpp [new file with mode: 0644]
modules/stitching/perf/perf_precomp.hpp [new file with mode: 0644]
modules/stitching/perf/perf_stich.cpp [new file with mode: 0644]

diff --git a/modules/stitching/perf/perf_main.cpp b/modules/stitching/perf/perf_main.cpp
new file mode 100644 (file)
index 0000000..0797856
--- /dev/null
@@ -0,0 +1,3 @@
+#include "perf_precomp.hpp"
+
+CV_PERF_TEST_MAIN(stitching)
diff --git a/modules/stitching/perf/perf_precomp.cpp b/modules/stitching/perf/perf_precomp.cpp
new file mode 100644 (file)
index 0000000..8552ac3
--- /dev/null
@@ -0,0 +1 @@
+#include "perf_precomp.hpp"
diff --git a/modules/stitching/perf/perf_precomp.hpp b/modules/stitching/perf/perf_precomp.hpp
new file mode 100644 (file)
index 0000000..3c2e8cf
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __OPENCV_PERF_PRECOMP_HPP__
+#define __OPENCV_PERF_PRECOMP_HPP__
+
+#include "opencv2/ts/ts.hpp"
+
+#include "opencv2/stitching/stitcher.hpp"
+
+#if GTEST_CREATE_SHARED_LIBRARY
+#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
+#endif
+
+#endif
diff --git a/modules/stitching/perf/perf_stich.cpp b/modules/stitching/perf/perf_stich.cpp
new file mode 100644 (file)
index 0000000..085d397
--- /dev/null
@@ -0,0 +1,44 @@
+#include "perf_precomp.hpp"\r
+\r
+#include "opencv2/highgui/highgui.hpp"\r
+\r
+using namespace std;\r
+using namespace cv;\r
+using namespace perf;\r
+\r
+\r
+/*\r
+// Stitcher::Status Stitcher::stitch(InputArray imgs, OutputArray pano)\r
+*/\r
+PERF_TEST( stitch3, a123 )\r
+{\r
+    Mat pano;\r
+    \r
+    vector<Mat> imgs;\r
+    imgs.push_back( imread( getDataPath("stitching/a1.jpg") ) );\r
+    imgs.push_back( imread( getDataPath("stitching/a2.jpg") ) );\r
+    imgs.push_back( imread( getDataPath("stitching/a3.jpg") ) );\r
+\r
+    Stitcher stitcher = Stitcher::createDefault();\r
+    Stitcher::Status status;\r
+\r
+    declare.time(30 * 20);\r
+\r
+    TEST_CYCLE(20) { status = stitcher.stitch(imgs, pano); }\r
+}\r
+\r
+PERF_TEST( stitch2, b12 )\r
+{\r
+    Mat pano;\r
+    \r
+    vector<Mat> imgs;\r
+    imgs.push_back( imread( getDataPath("stitching/b1.jpg") ) );\r
+    imgs.push_back( imread( getDataPath("stitching/b2.jpg") ) );\r
+\r
+    Stitcher stitcher = Stitcher::createDefault();\r
+    Stitcher::Status status;\r
+\r
+    declare.time(30 * 20);\r
+\r
+    TEST_CYCLE(20) { status = stitcher.stitch(imgs, pano); }\r
+}\r