1 | initial version |
Got this working after posting:
Mat newCamMatrix = calibCamMatrix.clone();
double scale = double(newWidth) / double(calibWidth);
newCamMatrix.at<double>(0,0) = scale * calibCamMatrix.at<double>(0,0);
newCamMatrix.at<double>(1,1) = scale * calibCamMatrix.at<double>(1,1);
newCamMatrix.at<double>(0,0) = scale * calibCamMatrix.at<double>(0,0);
newCamMatrix.at<double>(0,2) = scale * calibCamMatrix.at<double>(0,2);
newCamMatrix.at<double>(1,2) = scale * calibCamMatrix.at<double>(1,2);
calibCamMatrix is the matrix generated by the calibration process (where frame had x resolution of calibWidth). newCamMatrix is the modified matrix to be passed to initUndistortRectifyMap(), along with the new resolution (newWidth/yyy)
2 | No.2 Revision |
Got this working after posting:
Mat newCamMatrix = calibCamMatrix.clone();
double scale = double(newWidth) / double(calibWidth);
newCamMatrix.at<double>(0,0) = scale * calibCamMatrix.at<double>(0,0);
newCamMatrix.at<double>(1,1) = scale * calibCamMatrix.at<double>(1,1);
newCamMatrix.at<double>(0,0) = scale * calibCamMatrix.at<double>(0,0);
newCamMatrix.at<double>(0,2) = scale * calibCamMatrix.at<double>(0,2);
newCamMatrix.at<double>(1,2) = scale * calibCamMatrix.at<double>(1,2);
calibCamMatrix is the matrix generated by the calibration process (where frame had x resolution of calibWidth). newCamMatrix is the modified matrix to be passed to initUndistortRectifyMap(), along with the new resolution (newWidth/yyy)