perf_cicrlesGrid.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "perf_precomp.hpp"
  2. namespace opencv_test
  3. {
  4. using namespace perf;
  5. typedef tuple<std::string, cv::Size> String_Size_t;
  6. typedef perf::TestBaseWithParam<String_Size_t> String_Size;
  7. PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
  8. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles1.png", Size(7,13)),
  9. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles2.png", Size(7,13)),
  10. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles3.png", Size(7,13)),
  11. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles4.png", Size(5,5)),
  12. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles5.png", Size(5,5)),
  13. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles6.png", Size(5,5)),
  14. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles7.png", Size(3,9)),
  15. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles8.png", Size(3,9)),
  16. String_Size_t("cv/cameracalibration/asymmetric_circles/acircles9.png", Size(3,9))
  17. )
  18. )
  19. {
  20. string filename = getDataPath(get<0>(GetParam()));
  21. Size gridSize = get<1>(GetParam());
  22. Mat frame = imread(filename);
  23. if (frame.empty())
  24. FAIL() << "Unable to load source image " << filename;
  25. vector<Point2f> ptvec;
  26. ptvec.resize(gridSize.area());
  27. cvtColor(frame, frame, COLOR_BGR2GRAY);
  28. declare.in(frame).out(ptvec);
  29. TEST_CYCLE() ASSERT_TRUE(findCirclesGrid(frame, gridSize, ptvec, CALIB_CB_CLUSTERING | CALIB_CB_ASYMMETRIC_GRID));
  30. SANITY_CHECK(ptvec, 2);
  31. }
  32. } // namespace