1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +04:00

Fix stereoRectify image boundaries again.

This should have been fixed in https://github.com/opencv/opencv/pull/24035
This commit is contained in:
Vincent Rabaud
2023-12-05 13:36:17 +01:00
parent 903b66906e
commit 7f0a094e4e
+4 -4
View File
@@ -2707,11 +2707,11 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
s0);
double s1 = std::min(std::min(std::min((double)cx1/(cx1_0 - outer1.x), (double)cy1/(cy1_0 - outer1.y)),
(double)(newImgSize.width - cx1)/(outer1.x + outer1.width - cx1_0)),
(double)(newImgSize.height - cy1)/(outer1.y + outer1.height - cy1_0));
(double)(newImgSize.width - 1 - cx1)/(outer1.x + outer1.width - cx1_0)),
(double)(newImgSize.height - 1 - cy1)/(outer1.y + outer1.height - cy1_0));
s1 = std::min(std::min(std::min(std::min((double)cx2/(cx2_0 - outer2.x), (double)cy2/(cy2_0 - outer2.y)),
(double)(newImgSize.width - cx2)/(outer2.x + outer2.width - cx2_0)),
(double)(newImgSize.height - cy2)/(outer2.y + outer2.height - cy2_0)),
(double)(newImgSize.width - 1 - cx2)/(outer2.x + outer2.width - cx2_0)),
(double)(newImgSize.height - 1 - cy2)/(outer2.y + outer2.height - cy2_0)),
s1);
s = s0*(1 - alpha) + s1*alpha;