|
1 | 1 | #include "perf_precomp.hpp"
|
2 | 2 |
|
3 |
| -#ifdef HAVE_TBB |
4 |
| -#include "tbb/task_scheduler_init.h" |
5 |
| -#endif |
6 |
| - |
7 |
| -using namespace std; |
8 |
| -using namespace cv; |
| 3 | +namespace opencv_test |
| 4 | +{ |
9 | 5 | using namespace perf;
|
10 |
| -using std::tr1::make_tuple; |
11 |
| -using std::tr1::get; |
12 | 6 |
|
13 | 7 | CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_P3P, SOLVEPNP_DLS, SOLVEPNP_UPNP)
|
14 | 8 |
|
15 |
| -typedef std::tr1::tuple<int, pnpAlgo> PointsNum_Algo_t; |
| 9 | +typedef tuple<int, pnpAlgo> PointsNum_Algo_t; |
16 | 10 | typedef perf::TestBaseWithParam<PointsNum_Algo_t> PointsNum_Algo;
|
17 | 11 |
|
18 | 12 | typedef perf::TestBaseWithParam<int> PointsNum;
|
@@ -48,14 +42,14 @@ PERF_TEST_P(PointsNum_Algo, solvePnP,
|
48 | 42 | //add noise
|
49 | 43 | Mat noise(1, (int)points2d.size(), CV_32FC2);
|
50 | 44 | randu(noise, 0, 0.01);
|
51 |
| - add(points2d, noise, points2d); |
| 45 | + cv::add(points2d, noise, points2d); |
52 | 46 |
|
53 | 47 | declare.in(points3d, points2d);
|
54 | 48 | declare.time(100);
|
55 | 49 |
|
56 | 50 | TEST_CYCLE_N(1000)
|
57 | 51 | {
|
58 |
| - solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo); |
| 52 | + cv::solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo); |
59 | 53 | }
|
60 | 54 |
|
61 | 55 | SANITY_CHECK(rvec, 1e-6);
|
@@ -92,22 +86,22 @@ PERF_TEST_P(PointsNum_Algo, solvePnPSmallPoints,
|
92 | 86 |
|
93 | 87 | // normalize Rodrigues vector
|
94 | 88 | Mat rvec_tmp = Mat::eye(3, 3, CV_32F);
|
95 |
| - Rodrigues(rvec, rvec_tmp); |
96 |
| - Rodrigues(rvec_tmp, rvec); |
| 89 | + cv::Rodrigues(rvec, rvec_tmp); |
| 90 | + cv::Rodrigues(rvec_tmp, rvec); |
97 | 91 |
|
98 |
| - projectPoints(points3d, rvec, tvec, intrinsics, distortion, points2d); |
| 92 | + cv::projectPoints(points3d, rvec, tvec, intrinsics, distortion, points2d); |
99 | 93 |
|
100 | 94 | //add noise
|
101 | 95 | Mat noise(1, (int)points2d.size(), CV_32FC2);
|
102 | 96 | randu(noise, -0.001, 0.001);
|
103 |
| - add(points2d, noise, points2d); |
| 97 | + cv::add(points2d, noise, points2d); |
104 | 98 |
|
105 | 99 | declare.in(points3d, points2d);
|
106 | 100 | declare.time(100);
|
107 | 101 |
|
108 | 102 | TEST_CYCLE_N(1000)
|
109 | 103 | {
|
110 |
| - solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo); |
| 104 | + cv::solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo); |
111 | 105 | }
|
112 | 106 |
|
113 | 107 | SANITY_CHECK(rvec, 1e-1);
|
@@ -144,16 +138,13 @@ PERF_TEST_P(PointsNum, DISABLED_SolvePnPRansac, testing::Values(5, 3*9, 7*13))
|
144 | 138 | Mat rvec;
|
145 | 139 | Mat tvec;
|
146 | 140 |
|
147 |
| -#ifdef HAVE_TBB |
148 |
| - // limit concurrency to get deterministic result |
149 |
| - tbb::task_scheduler_init one_thread(1); |
150 |
| -#endif |
151 |
| - |
152 | 141 | TEST_CYCLE()
|
153 | 142 | {
|
154 |
| - solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec); |
| 143 | + cv::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec); |
155 | 144 | }
|
156 | 145 |
|
157 | 146 | SANITY_CHECK(rvec, 1e-6);
|
158 | 147 | SANITY_CHECK(tvec, 1e-6);
|
159 | 148 | }
|
| 149 | + |
| 150 | +} // namespace |
0 commit comments