stitching(perf): workaround test failures
authorAlexander Alekhin <alexander.alekhin@intel.com>
Wed, 1 Mar 2017 11:28:23 +0000 (14:28 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Thu, 2 Mar 2017 10:45:12 +0000 (13:45 +0300)
force other RNG seed

modules/stitching/perf/perf_stich.cpp

index ded2571..ee78d6d 100644 (file)
@@ -2,6 +2,8 @@
 #include "opencv2/imgcodecs.hpp"
 #include "opencv2/opencv_modules.hpp"
 
+#include "opencv2/core/ocl.hpp"
+
 using namespace std;
 using namespace cv;
 using namespace perf;
@@ -161,6 +163,9 @@ PERF_TEST_P(stitchDatasets, affine, testing::Combine(AFFINE_DATASETS, TEST_DETEC
         Ptr<Stitcher> stitcher = Stitcher::create(Stitcher::SCANS, false);
         stitcher->setFeaturesFinder(featuresFinder);
 
+        if (cv::ocl::useOpenCL())
+            cv::theRNG() = cv::RNG(12345); // prevent fails of Windows OpenCL builds (see #8294)
+
         startTimer();
         stitcher->stitch(imgs, pano);
         stopTimer();