I calibrate fisheye stereo with -
Mat R, T;
rms = fisheye::stereoCalibrate(Vobjpoints, Limgpoints, Rimgpoints, LcameraMatrix, LdistCoeffs, RcameraMatrix, RdistCoeffs,
Lgray.size(), R, T, fisheye::CALIB_FIX_INTRINSIC, TermCriteria(TermCriteria::EPS + TermCriteria::MAX_ITER, 30, 0.01));
Mat R1 = Mat::zeros(3, 3, CV_64F);
Mat R2 = Mat::zeros(3, 3, CV_64F);
Mat P1 = Mat::zeros(3, 4, CV_64F);
Mat P2 = Mat::zeros(3, 4, CV_64F);
Mat disparityToDepthMap;
fisheye::stereoRectify(LcameraMatrix, LdistCoeffs, RcameraMatrix, RdistCoeffs,
Lgray.size(), R, T, R1, R2, P1, P2, disparityToDepthMap, CALIB_ZERO_DISPARITY);
And trying to reproject stereoimage with -
Mat To3D;
reprojectImageTo3D(disparity, To3D, QQ);
as QQ is same as previous disparityToDepthMap
but I got error ±
OpenCV(4.7.0) Error: Assertion failed (Q.size() == Size(4,4)) in cv::reprojectImageTo3D, file C:\Users\Raivo\opencv-4.7.0\modules\calib3d\src\calibration.cpp, line 3051
Truely QQ is 4,4 size as gaved by fisheye::stereoRectify
What the problem is ?