Skip to content

Commit

Permalink
added note for downward-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobEngel committed Nov 6, 2014
1 parent dd9fc73 commit b4ac3bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ This one is without radial distortion correction, as a special case of ATAN came
width height


#### Calibration File for OpenCV camera model [untested!]:
#### Calibration File for OpenCV camera model:

fx fy cx cy k1 k2 p1 p2
inputWidth inputHeight
Expand Down
17 changes: 17 additions & 0 deletions lsd_slam_core/src/util/Undistorter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,23 @@ UndistorterOpenCV::UndistorterOpenCV(const char* configFileName)
for (int i = 0; i < 4; ++ i)
distCoeffs.at<float>(i, 0) = inputCalibration[4 + i];

if(inputCalibration[2] < 1.0f)
{
printf("WARNING: cx = %f < 1, which should not be the case for normal cameras.!\n", inputCalibration[2]);
printf("Possibly this is due to a recent change in the calibration file format, please see the README.md.\n");

inputCalibration[0] *= in_width;
inputCalibration[2] *= in_width;
inputCalibration[1] *= in_height;
inputCalibration[3] *= in_height;

printf("auto-changing calibration file to fx=%f, fy=%f, cx=%f, cy=%f\n",
inputCalibration[0],
inputCalibration[1],
inputCalibration[2],
inputCalibration[3]);
}

originalK_ = cv::Mat(3, 3, CV_64F, cv::Scalar(0));
originalK_.at<double>(0, 0) = inputCalibration[0];
originalK_.at<double>(1, 1) = inputCalibration[1];
Expand Down

0 comments on commit b4ac3bb

Please sign in to comment.