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