mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Fix stereoRectify image boundaries.
This should hav ebeen fixed with https://github.com/opencv/opencv/issues/23304
This commit is contained in:
committed by
Alexander Smorkalov
parent
1794cdc03c
commit
15815fb54d
@@ -2150,6 +2150,54 @@ TEST(Calib3d_StereoCalibrate, regression_11131)
|
||||
EXPECT_GE(roi2.area(), 400*300) << roi2;
|
||||
}
|
||||
|
||||
TEST(Calib3d_StereoCalibrate, 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,
|
||||
CALIB_ZERO_DISPARITY, 0, imageSize, &roi1, &roi2);
|
||||
|
||||
EXPECT_EQ(cv::norm(P1, P1_gold), 0.);
|
||||
EXPECT_EQ(cv::norm(P2, P2_gold), 0.);
|
||||
}
|
||||
|
||||
TEST(Calib3d_Triangulate, accuracy)
|
||||
{
|
||||
// the testcase from http://code.opencv.org/issues/4334
|
||||
|
||||
Reference in New Issue
Block a user