38 os <<
", xi: " << cal.
xi();
63 const double xi =
xi_;
66 const double xs = p.x(), ys = p.y();
67 const double sqrt_nx =
sqrt(xs * xs + ys * ys + 1.0);
68 const double xi_sqrt_nx = 1.0 / (1 + xi * sqrt_nx);
69 const double xi_sqrt_nx2 = xi_sqrt_nx * xi_sqrt_nx;
70 const double x = xs * xi_sqrt_nx,
y = ys * xi_sqrt_nx;
82 DU << -xs * sqrt_nx * xi_sqrt_nx2,
83 -ys * sqrt_nx * xi_sqrt_nx2;
84 *Dcal << H1base, H2base * DU;
90 const double denom = 1.0 * xi_sqrt_nx2 / sqrt_nx;
91 const double mid = -(xi * xs * ys) * denom;
93 DU << (sqrt_nx + xi * (ys * ys + 1)) * denom, mid,
94 mid, (sqrt_nx + xi * (xs * xs + 1)) * denom;
111 calibrateJacobians<Cal3Unified, dimension>(*
this, pn, Dcal, Dp);
117 const double x = p.x(),
y = p.y();
118 const double xy2 = x * x +
y *
y;
119 const double sq_xy = (
xi_ +
sqrt(1 + (1 -
xi_ *
xi_) * xy2)) / (xy2 + 1);
121 return Point2((sq_xy * x / (sq_xy - xi_)), (sq_xy * y / (sq_xy - xi_)));
126 const double x = p.x(),
y = p.y();
127 const double sq_xy = 1 +
xi_ *
sqrt(x * x +
y *
y + 1);
129 return Point2((x / sq_xy), (
y / sq_xy));
void print(const Matrix &A, const string &s, ostream &stream)
bool equals(const Cal3Unified &K, double tol=10e-9) const
assert equality up to a tolerance
void print(const std::string &s="") const override
print with optional string
Point2 uncalibrate(const Point2 &p, OptionalJacobian< 2, 10 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
Calibration of a camera with radial distortion.
static const Pose3 T2(Rot3::Rodrigues(0.3, 0.2, 0.1), P2)
Cal3Unified retract(const Vector &d) const
Given delta vector, update calibration.
Point2 nPlaneToSpace(const Point2 &p) const
Convert a normalized unit plane point to 3D space.
Array< int, Dynamic, 1 > v
double xi() const
mirror parameter
Vector localCoordinates(const Cal3Unified &T2) const
Given a different calibration, calculate update to obtain it.
Cal3Unified()=default
Default Constructor with only unit focal length.
Vector9 vector() const
Return all parameters as a vector.
double xi_
mirror parameter
void print(const std::string &s="") const override
print with optional string
Point2 calibrate(const Point2 &p, OptionalJacobian< 2, 9 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
Convert (distorted) image coordinates uv to intrinsic coordinates xy.
virtual Matrix3 K() const
return calibration matrix K
typedef and functions to augment Eigen's VectorXd
Point2 uncalibrate(const Point2 &p, OptionalJacobian< 2, 9 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
Calibration of a omni-directional camera with mirror + lens radial distortion.
ofstream os("timeSchurFactors.csv")
bool equals(const Cal3DS2_Base &K, double tol=1e-8) const
assert equality up to a tolerance
Point2 spaceToNPlane(const Point2 &p) const
Convert a 3D point to normalized unit plane.
Jet< T, N > sqrt(const Jet< T, N > &f)
Annotation indicating that a class derives from another given type.
Unified Calibration Model, see Mei07icra for details.
Vector10 vector() const
Return all parameters as a vector.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Point2 calibrate(const Point2 &p, OptionalJacobian< 2, 10 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
Conver a pixel coordinate to ideal coordinate.
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &os, const Cal3Unified &cal)
Output stream operator.