mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-13 05:19:51 +08:00
depthai: Adding assert for min expected coeffs
This commit is contained in:
@@ -370,9 +370,10 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin
|
|||||||
matrix[2][0], matrix[2][1], matrix[2][2]);
|
matrix[2][0], matrix[2][1], matrix[2][2]);
|
||||||
|
|
||||||
std::vector<float> coeffs = calibHandler.getDistortionCoefficients(cameraId);
|
std::vector<float> coeffs = calibHandler.getDistortionCoefficients(cameraId);
|
||||||
if(calibHandler.getDistortionModel(cameraId) == dai::CameraModel::Perspective)
|
if(calibHandler.getDistortionModel(cameraId) == dai::CameraModel::Perspective) {
|
||||||
|
UASSERT(coeffs.size()>=14);
|
||||||
distCoeffs = (cv::Mat_<double>(1,14) << coeffs[0], coeffs[1], coeffs[2], coeffs[3], coeffs[4], coeffs[5], coeffs[6], coeffs[7], coeffs[8], coeffs[9], coeffs[10], coeffs[11], coeffs[12], coeffs[13]);
|
distCoeffs = (cv::Mat_<double>(1,14) << coeffs[0], coeffs[1], coeffs[2], coeffs[3], coeffs[4], coeffs[5], coeffs[6], coeffs[7], coeffs[8], coeffs[9], coeffs[10], coeffs[11], coeffs[12], coeffs[13]);
|
||||||
|
}
|
||||||
if(alphaScaling_>-1.0f)
|
if(alphaScaling_>-1.0f)
|
||||||
newCameraMatrix = cv::getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, targetSize_, alphaScaling_);
|
newCameraMatrix = cv::getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, targetSize_, alphaScaling_);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user