mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Fixed compilation with OpenCV 4.2 #502 (see ad146e5a6b and https://github.com/opencv/opencv/pull/16046)
This commit is contained in:
@@ -1187,11 +1187,20 @@ void stereoRectifyFisheye( cv::InputArray _cameraMatrix1, cv::InputArray _distCo
|
||||
cv::Mat cameraMatrix1 = _cameraMatrix1.getMat(), cameraMatrix2 = _cameraMatrix2.getMat();
|
||||
cv::Mat distCoeffs1 = _distCoeffs1.getMat(), distCoeffs2 = _distCoeffs2.getMat();
|
||||
cv::Mat Rmat = _Rmat.getMat(), Tmat = _Tmat.getMat();
|
||||
|
||||
#if CV_MAJOR_VERSION > 3 or (CV_MAJOR_VERSION >= 3 and (CV_MAJOR_VERSION>4 or CV_MAJOR_VERSION>=4 and CV_MAJOR_VERSION>=4))
|
||||
CvMat c_cameraMatrix1 = cvMat(cameraMatrix1);
|
||||
CvMat c_cameraMatrix2 = cvMat(cameraMatrix2);
|
||||
CvMat c_distCoeffs1 = cvMat(distCoeffs1);
|
||||
CvMat c_distCoeffs2 = cvMat(distCoeffs2);
|
||||
CvMat c_R = cvMat(Rmat), c_T = cvMat(Tmat);
|
||||
#else
|
||||
CvMat c_cameraMatrix1 = CvMat(cameraMatrix1);
|
||||
CvMat c_cameraMatrix2 = CvMat(cameraMatrix2);
|
||||
CvMat c_distCoeffs1 = CvMat(distCoeffs1);
|
||||
CvMat c_distCoeffs2 = CvMat(distCoeffs2);
|
||||
CvMat c_R = CvMat(Rmat), c_T = CvMat(Tmat);
|
||||
#endif
|
||||
|
||||
int rtype = CV_64F;
|
||||
_Rmat1.create(3, 3, rtype);
|
||||
@@ -1199,20 +1208,33 @@ void stereoRectifyFisheye( cv::InputArray _cameraMatrix1, cv::InputArray _distCo
|
||||
_Pmat1.create(3, 4, rtype);
|
||||
_Pmat2.create(3, 4, rtype);
|
||||
cv::Mat R1 = _Rmat1.getMat(), R2 = _Rmat2.getMat(), P1 = _Pmat1.getMat(), P2 = _Pmat2.getMat(), Q;
|
||||
#if CV_MAJOR_VERSION > 3 or (CV_MAJOR_VERSION >= 3 and (CV_MAJOR_VERSION>4 or CV_MAJOR_VERSION>=4 and CV_MAJOR_VERSION>=4))
|
||||
CvMat c_R1 = cvMat(R1), c_R2 = cvMat(R2), c_P1 = cvMat(P1), c_P2 = cvMat(P2);
|
||||
#else
|
||||
CvMat c_R1 = CvMat(R1), c_R2 = CvMat(R2), c_P1 = CvMat(P1), c_P2 = CvMat(P2);
|
||||
#endif
|
||||
CvMat c_Q, *p_Q = 0;
|
||||
|
||||
if( _Qmat.needed() )
|
||||
{
|
||||
_Qmat.create(4, 4, rtype);
|
||||
#if CV_MAJOR_VERSION > 3 or (CV_MAJOR_VERSION >= 3 and (CV_MAJOR_VERSION>4 or CV_MAJOR_VERSION>=4 and CV_MAJOR_VERSION>=4))
|
||||
p_Q = &(c_Q = cvMat(Q = _Qmat.getMat()));
|
||||
#else
|
||||
p_Q = &(c_Q = CvMat(Q = _Qmat.getMat()));
|
||||
#endif
|
||||
}
|
||||
|
||||
CvMat *p_distCoeffs1 = distCoeffs1.empty() ? NULL : &c_distCoeffs1;
|
||||
CvMat *p_distCoeffs2 = distCoeffs2.empty() ? NULL : &c_distCoeffs2;
|
||||
cvStereoRectifyFisheye( &c_cameraMatrix1, &c_cameraMatrix2, p_distCoeffs1, p_distCoeffs2,
|
||||
#if CV_MAJOR_VERSION > 3 or (CV_MAJOR_VERSION >= 3 and (CV_MAJOR_VERSION>4 or CV_MAJOR_VERSION>=4 and CV_MAJOR_VERSION>=4))
|
||||
cvSize(imageSize), &c_R, &c_T, &c_R1, &c_R2, &c_P1, &c_P2, p_Q, flags, alpha,
|
||||
cvSize(newImageSize));
|
||||
#else
|
||||
CvSize(imageSize), &c_R, &c_T, &c_R1, &c_R2, &c_P1, &c_P2, p_Q, flags, alpha,
|
||||
CvSize(newImageSize));
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user