1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 08:44:11 +08:00

build: fix C++17 build

This commit is contained in:
Alexander Alekhin
2018-02-08 16:00:41 +03:00
parent 4cb11f23e4
commit af58e08ee2
2 changed files with 19 additions and 1 deletions

View File

@@ -40,13 +40,16 @@
//
//M*/
#include "precomp.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/private.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgcodecs.hpp"
#include "precomp.hpp"
#include "opencl_kernels_optflow.hpp"
#include "opencv2/core/hal/intrin.hpp"
#ifdef CV_CXX11
#include <random> // std::mt19937
#endif
/* Disable "from double to float" and "from size_t to int" warnings.
* Fixing these would make the code look ugly by introducing explicit cast all around.
@@ -402,7 +405,12 @@ void getTrainingSamples( const Mat &from, const Mat &to, const Mat &gt, GPCSampl
// with a small displacement and train to better distinguish hard pairs.
std::nth_element( mag.begin(), mag.begin() + n, mag.end() );
mag.resize( n );
#ifdef CV_CXX11
std::mt19937 std_rng(cv::theRNG()());
std::shuffle(mag.begin(), mag.end(), std_rng);
#else
std::random_shuffle( mag.begin(), mag.end() );
#endif
n /= patchRadius;
mag.resize( n );