perf_tvl1optflow.cpp 830 B

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