1 #include "perf_precomp.hpp"
2
3 using namespace std;
4 using namespace cv;
5 using namespace perf;
6
7 typedef TestBaseWithParam< pair<string, string> > ImagePair;
8
impair(const char * im1,const char * im2)9 pair<string, string> impair(const char* im1, const char* im2)
10 {
11 return make_pair(string(im1), string(im2));
12 }
13
14 PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1, testing::Values(impair("cv/optflow/RubberWhale1.png", "cv/optflow/RubberWhale2.png")))
15 {
16 declare.time(260);
17
18 Mat frame1 = imread(getDataPath(GetParam().first), IMREAD_GRAYSCALE);
19 Mat frame2 = imread(getDataPath(GetParam().second), IMREAD_GRAYSCALE);
20 ASSERT_FALSE(frame1.empty());
21 ASSERT_FALSE(frame2.empty());
22
23 Mat flow;
24
25 Ptr<DenseOpticalFlow> tvl1 = createOptFlow_DualTVL1();
26
27 TEST_CYCLE_N(10) tvl1->calc(frame1, frame2, flow);
28
29 SANITY_CHECK(flow, 0.8);
30 }
31