2013-02-13 19:42:58 +08:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
2017-11-05 21:48:40 +08:00
|
|
|
namespace opencv_test { namespace {
|
2013-02-13 19:42:58 +08:00
|
|
|
using namespace perf;
|
|
|
|
|
2017-11-05 21:48:40 +08:00
|
|
|
typedef TestBaseWithParam< std::pair<string, string> > ImagePair;
|
2013-02-13 19:42:58 +08:00
|
|
|
|
2017-11-05 21:48:40 +08:00
|
|
|
std::pair<string, string> impair(const char* im1, const char* im2)
|
2013-02-13 19:42:58 +08:00
|
|
|
{
|
2017-11-05 21:48:40 +08:00
|
|
|
return std::make_pair(string(im1), string(im2));
|
2013-02-13 19:42:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1, testing::Values(impair("cv/optflow/RubberWhale1.png", "cv/optflow/RubberWhale2.png")))
|
|
|
|
{
|
2013-02-20 20:59:17 +08:00
|
|
|
declare.time(260);
|
2013-02-13 19:42:58 +08:00
|
|
|
|
|
|
|
Mat frame1 = imread(getDataPath(GetParam().first), IMREAD_GRAYSCALE);
|
|
|
|
Mat frame2 = imread(getDataPath(GetParam().second), IMREAD_GRAYSCALE);
|
|
|
|
ASSERT_FALSE(frame1.empty());
|
|
|
|
ASSERT_FALSE(frame2.empty());
|
|
|
|
|
|
|
|
Mat flow;
|
|
|
|
|
2013-02-14 17:26:47 +08:00
|
|
|
Ptr<DenseOpticalFlow> tvl1 = createOptFlow_DualTVL1();
|
2013-02-13 19:42:58 +08:00
|
|
|
|
2016-11-10 20:41:44 +08:00
|
|
|
TEST_CYCLE() tvl1->calc(frame1, frame2, flow);
|
2013-02-13 19:42:58 +08:00
|
|
|
|
2016-11-10 20:41:44 +08:00
|
|
|
SANITY_CHECK_NOTHING();
|
2013-02-13 19:42:58 +08:00
|
|
|
}
|
2017-11-05 21:48:40 +08:00
|
|
|
|
|
|
|
}} // namespace
|