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

Port stereoRectify grid fix #24035.

This commit is contained in:
Alexander Smorkalov
2023-08-02 15:57:37 +03:00
parent 9ddf1e5c77
commit da28c62855
2 changed files with 52 additions and 4 deletions
+4 -4
View File
@@ -255,11 +255,11 @@ void stereoRectify( InputArray _cameraMatrix1, InputArray _distCoeffs1,
if( alpha >= 0 )
{
double s0 = std::max(std::max(std::max((double)cx1/(cx1_0 - inner1.x), (double)cy1/(cy1_0 - inner1.y)),
(double)(newImgSize.width - cx1)/(inner1.x + inner1.width - cx1_0)),
(double)(newImgSize.height - cy1)/(inner1.y + inner1.height - cy1_0));
(double)(newImgSize.width - 1 - cx1)/(inner1.x + inner1.width - cx1_0)),
(double)(newImgSize.height - 1 - cy1)/(inner1.y + inner1.height - cy1_0));
s0 = std::max(std::max(std::max(std::max((double)cx2/(cx2_0 - inner2.x), (double)cy2/(cy2_0 - inner2.y)),
(double)(newImgSize.width - cx2)/(inner2.x + inner2.width - cx2_0)),
(double)(newImgSize.height - cy2)/(inner2.y + inner2.height - cy2_0)),
(double)(newImgSize.width - 1 - cx2)/(inner2.x + inner2.width - cx2_0)),
(double)(newImgSize.height - 1 - cy2)/(inner2.y + inner2.height - cy2_0)),
s0);
double s1 = std::min(std::min(std::min((double)cx1/(cx1_0 - outer1.x), (double)cy1/(cy1_0 - outer1.y)),