mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge branch 4.x
This commit is contained in:
@@ -131,20 +131,20 @@ TEST_F(fisheyeTest, distortUndistortPoints)
|
||||
|
||||
/* Test with random D set */
|
||||
for (size_t i = 0; i < 10; ++i) {
|
||||
cv::Mat D(1, 4, CV_64F);
|
||||
theRNG().fill(D, cv::RNG::UNIFORM, -0.00001, 0.00001);
|
||||
cv::Mat distortion(1, 4, CV_64F);
|
||||
theRNG().fill(distortion, cv::RNG::UNIFORM, -0.00001, 0.00001);
|
||||
|
||||
/* Distort -> Undistort */
|
||||
cv::Mat distortedPoints;
|
||||
cv::fisheye::distortPoints(points0, distortedPoints, K, D);
|
||||
cv::fisheye::distortPoints(points0, distortedPoints, K, distortion);
|
||||
cv::Mat undistortedPoints;
|
||||
cv::fisheye::undistortPoints(distortedPoints, undistortedPoints, K, D);
|
||||
cv::fisheye::undistortPoints(distortedPoints, undistortedPoints, K, distortion);
|
||||
|
||||
EXPECT_MAT_NEAR(points0, undistortedPoints, 1e-8);
|
||||
|
||||
/* Undistort -> Distort */
|
||||
cv::fisheye::undistortPoints(points0, undistortedPoints, K, D);
|
||||
cv::fisheye::distortPoints(undistortedPoints, distortedPoints, K, D);
|
||||
cv::fisheye::undistortPoints(points0, undistortedPoints, K, distortion);
|
||||
cv::fisheye::distortPoints(undistortedPoints, distortedPoints, K, distortion);
|
||||
|
||||
EXPECT_MAT_NEAR(points0, distortedPoints, 1e-8);
|
||||
}
|
||||
@@ -227,7 +227,7 @@ TEST_F(fisheyeTest, undistortAndDistortImage)
|
||||
cv::Mat undPointsGt(imageHeight, imageWidth, CV_32FC2);
|
||||
cv::Mat imageGt(imageHeight, imageWidth, CV_8UC3);
|
||||
|
||||
for(int y = 0, k = 0; y < imageHeight; ++y)
|
||||
for(int y = 0; y < imageHeight; ++y)
|
||||
{
|
||||
for(int x = 0; x < imageWidth; ++x)
|
||||
{
|
||||
@@ -261,7 +261,6 @@ TEST_F(fisheyeTest, undistortAndDistortImage)
|
||||
pixel_gt[2] = pixel[2];
|
||||
}
|
||||
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user