Skip to content

Commit 66af007

Browse files
Improved accuracy for analytic undistortion
1 parent a411b66 commit 66af007

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gtsam/geometry/Cal3Fisheye.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ Point2 Cal3Fisheye::calibrate(const Point2& uv, OptionalJacobian<2, 9> Dcal,
110110
const double u = uv.x(), v = uv.y();
111111
const double yd = (v - v0_) / fy_;
112112
const double xd = (u - s_ * yd - u0_) / fx_;
113-
Point2 pi(xd, yd);
113+
const double theta = sqrt(xd * xd + yd * yd);
114+
const double scale = (theta > 0) ? tan(theta) / theta;
115+
Point2 pi(scale * xd, scale * yd);
114116

115117
// Perform newtons method, break when solution converges past tol_,
116118
// throw exception if max iterations are reached

0 commit comments

Comments
 (0)