mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Port stereoRectify grid fix #24035.
This commit is contained in:
@@ -178,6 +178,54 @@ TEST(StereoGeometry, regression_11131)
|
||||
EXPECT_GE(roi2.area(), 400*300) << roi2;
|
||||
}
|
||||
|
||||
TEST(StereoGeometry, regression_23305)
|
||||
{
|
||||
const Matx33d M1(
|
||||
850, 0, 640,
|
||||
0, 850, 640,
|
||||
0, 0, 1
|
||||
);
|
||||
|
||||
const Matx34d P1_gold(
|
||||
850, 0, 640, 0,
|
||||
0, 850, 640, 0,
|
||||
0, 0, 1, 0
|
||||
);
|
||||
|
||||
const Matx33d M2(
|
||||
850, 0, 640,
|
||||
0, 850, 640,
|
||||
0, 0, 1
|
||||
);
|
||||
|
||||
const Matx34d P2_gold(
|
||||
850, 0, 640, -2*850, // correcponds to T(-2., 0., 0.)
|
||||
0, 850, 640, 0,
|
||||
0, 0, 1, 0
|
||||
);
|
||||
|
||||
const Matx<double, 5, 1> D1(0, 0, 0, 0, 0);
|
||||
const Matx<double, 5, 1> D2(0, 0, 0, 0, 0);
|
||||
|
||||
const Matx33d R(
|
||||
1., 0., 0.,
|
||||
0., 1., 0.,
|
||||
0., 0., 1.
|
||||
);
|
||||
const Matx31d T(-2., 0., 0.);
|
||||
|
||||
const Size imageSize(1280, 1280);
|
||||
|
||||
Mat R1, R2, P1, P2, Q;
|
||||
Rect roi1, roi2;
|
||||
stereoRectify(M1, D1, M2, D2, imageSize, R, T,
|
||||
R1, R2, P1, P2, Q,
|
||||
STEREO_ZERO_DISPARITY, 0, imageSize, &roi1, &roi2);
|
||||
|
||||
EXPECT_EQ(cv::norm(P1, P1_gold), 0.);
|
||||
EXPECT_EQ(cv::norm(P2, P2_gold), 0.);
|
||||
}
|
||||
|
||||
class fisheyeTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user