Line 125... |
Line 125... |
125 |
cal.frameWidth = calibrationData[0].frame0.cols;
|
125 |
cal.frameWidth = calibrationData[0].frame0.cols;
|
126 |
cal.frameHeight = calibrationData[0].frame0.rows;
|
126 |
cal.frameHeight = calibrationData[0].frame0.rows;
|
127 |
cv::Size frameSize(cal.frameWidth, cal.frameHeight);
|
127 |
cv::Size frameSize(cal.frameWidth, cal.frameHeight);
|
128 |
|
128 |
|
129 |
// determine only k1, k2 for lens distortion
|
129 |
// determine only k1, k2 for lens distortion
|
130 |
int flags = cv::CALIB_FIX_K3 + cv::CALIB_ZERO_TANGENT_DIST + cv::CALIB_FIX_PRINCIPAL_POINT + cv::CALIB_FIX_ASPECT_RATIO;
|
130 |
int flags = cv::CALIB_FIX_ASPECT_RATIO + cv::CALIB_FIX_K2 + cv::CALIB_FIX_K3 + cv::CALIB_ZERO_TANGENT_DIST + cv::CALIB_FIX_PRINCIPAL_POINT;
|
131 |
// Note: several of the output arguments below must be cv::Mat, otherwise segfault
|
131 |
// Note: several of the output arguments below must be cv::Mat, otherwise segfault
|
132 |
std::vector<cv::Mat> cam_rvecs0, cam_tvecs0;
|
132 |
std::vector<cv::Mat> cam_rvecs0, cam_tvecs0;
|
133 |
cal.cam0_error = cv::calibrateCamera(Q0, qc0, frameSize, cal.K0, cal.k0, cam_rvecs0, cam_tvecs0, flags,
|
133 |
cal.cam0_error = cv::calibrateCamera(Q0, qc0, frameSize, cal.K0, cal.k0, cam_rvecs0, cam_tvecs0, flags,
|
134 |
cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 100, DBL_EPSILON));
|
134 |
cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 100, DBL_EPSILON));
|
135 |
//std::cout << cal.k0 << std::endl;
|
135 |
//std::cout << cal.k0 << std::endl;
|