mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 09:25:45 +08:00
build: eliminate warnings
This commit is contained in:
parent
d9bf522b27
commit
434c96e625
@ -27,31 +27,27 @@ PERF_TEST(Undistort, DISABLED_InitInverseRectificationMap)
|
|||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
using PerfIntType = perf::TestBaseWithParam<std::tuple<int>>;
|
PERF_TEST(Undistort, fisheye_undistortPoints_100k_10iter)
|
||||||
PERF_TEST_P(PerfIntType, fisheye_undistortPoints,
|
|
||||||
(testing::Values(1e2, 1e3, 1e4)))
|
|
||||||
{
|
{
|
||||||
const cv::Size imageSize(1280, 800);
|
const int pointsNumber = 100000;
|
||||||
|
const Size imageSize(1280, 800);
|
||||||
|
|
||||||
/* Set camera matrix */
|
/* Set camera matrix */
|
||||||
const cv::Matx33d K(558.478087865323, 0, 620.458515360843,
|
const Matx33d K(558.478087865323, 0, 620.458515360843,
|
||||||
0, 560.506767351568, 381.939424848348,
|
0, 560.506767351568, 381.939424848348,
|
||||||
0, 0, 1);
|
0, 0, 1);
|
||||||
|
|
||||||
/* Set distortion coefficients */
|
/* Set distortion coefficients */
|
||||||
Mat D(1, 4, CV_64F);
|
const Matx14d D(2.81e-06, 1.31e-06, -4.42e-06, -1.25e-06);
|
||||||
theRNG().fill(D, RNG::UNIFORM, -1.e-5, 1.e-5);
|
|
||||||
|
|
||||||
int pointsNumber = std::get<0>(GetParam());
|
|
||||||
|
|
||||||
/* Create two-channel points matrix */
|
/* Create two-channel points matrix */
|
||||||
cv::Mat xy[2] = {};
|
Mat xy[2] = {};
|
||||||
xy[0].create(pointsNumber, 1, CV_64F);
|
xy[0].create(pointsNumber, 1, CV_64F);
|
||||||
theRNG().fill(xy[0], cv::RNG::UNIFORM, 0, imageSize.width); // x
|
theRNG().fill(xy[0], RNG::UNIFORM, 0, imageSize.width); // x
|
||||||
xy[1].create(pointsNumber, 1, CV_64F);
|
xy[1].create(pointsNumber, 1, CV_64F);
|
||||||
theRNG().fill(xy[1], cv::RNG::UNIFORM, 0, imageSize.height); // y
|
theRNG().fill(xy[1], RNG::UNIFORM, 0, imageSize.height); // y
|
||||||
|
|
||||||
cv::Mat points;
|
Mat points;
|
||||||
merge(xy, 2, points);
|
merge(xy, 2, points);
|
||||||
|
|
||||||
/* Set fixed iteration number to check only c++ code, not algo convergence */
|
/* Set fixed iteration number to check only c++ code, not algo convergence */
|
||||||
|
@ -375,7 +375,7 @@ void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted
|
|||||||
size_t n = distorted.total();
|
size_t n = distorted.total();
|
||||||
int sdepth = distorted.depth();
|
int sdepth = distorted.depth();
|
||||||
|
|
||||||
const bool isEps = criteria.type & TermCriteria::EPS;
|
const bool isEps = (criteria.type & TermCriteria::EPS) != 0;
|
||||||
|
|
||||||
/* Define max count for solver iterations */
|
/* Define max count for solver iterations */
|
||||||
int maxCount = std::numeric_limits<int>::max();
|
int maxCount = std::numeric_limits<int>::max();
|
||||||
|
@ -131,20 +131,20 @@ TEST_F(fisheyeTest, distortUndistortPoints)
|
|||||||
|
|
||||||
/* Test with random D set */
|
/* Test with random D set */
|
||||||
for (size_t i = 0; i < 10; ++i) {
|
for (size_t i = 0; i < 10; ++i) {
|
||||||
cv::Mat D(1, 4, CV_64F);
|
cv::Mat distortion(1, 4, CV_64F);
|
||||||
theRNG().fill(D, cv::RNG::UNIFORM, -0.00001, 0.00001);
|
theRNG().fill(distortion, cv::RNG::UNIFORM, -0.00001, 0.00001);
|
||||||
|
|
||||||
/* Distort -> Undistort */
|
/* Distort -> Undistort */
|
||||||
cv::Mat distortedPoints;
|
cv::Mat distortedPoints;
|
||||||
cv::fisheye::distortPoints(points0, distortedPoints, K, D);
|
cv::fisheye::distortPoints(points0, distortedPoints, K, distortion);
|
||||||
cv::Mat undistortedPoints;
|
cv::Mat undistortedPoints;
|
||||||
cv::fisheye::undistortPoints(distortedPoints, undistortedPoints, K, D);
|
cv::fisheye::undistortPoints(distortedPoints, undistortedPoints, K, distortion);
|
||||||
|
|
||||||
EXPECT_MAT_NEAR(points0, undistortedPoints, 1e-8);
|
EXPECT_MAT_NEAR(points0, undistortedPoints, 1e-8);
|
||||||
|
|
||||||
/* Undistort -> Distort */
|
/* Undistort -> Distort */
|
||||||
cv::fisheye::undistortPoints(points0, undistortedPoints, K, D);
|
cv::fisheye::undistortPoints(points0, undistortedPoints, K, distortion);
|
||||||
cv::fisheye::distortPoints(undistortedPoints, distortedPoints, K, D);
|
cv::fisheye::distortPoints(undistortedPoints, distortedPoints, K, distortion);
|
||||||
|
|
||||||
EXPECT_MAT_NEAR(points0, distortedPoints, 1e-8);
|
EXPECT_MAT_NEAR(points0, distortedPoints, 1e-8);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user