46 os <<
"f: " << cal.
fx() <<
", k1: " << cal.
k1() <<
", k2: " << cal.
k2()
47 <<
", px: " << cal.
px() <<
", py: " << cal.
py();
71 const double x = p.x(),
y = p.y();
72 const double r = x * x +
y *
y;
73 const double g = 1. + (
k1_ +
k2_ * r) * r;
74 const double u = g *
x,
v = g *
y;
76 const double f_ =
fx_;
80 double rx = r *
x, ry = r *
y;
81 *Dcal << u, f_ * rx, f_ * r * rx,
v, f_ * ry, f_ * r * ry;
85 const double a = 2. * (
k1_ + 2. *
k2_ * r);
86 const double axx = a * x *
x, axy = a * x *
y, ayy = a * y *
y;
87 *Dp << g + axx, axy, axy, g + ayy;
109 for (iteration = 0; iteration <
maxIterations; ++iteration) {
111 const double px = pn.x(),
py = pn.y(), xx = px *
px, yy =
py *
py;
112 const double rr = xx + yy;
113 const double g = (1 +
k1_ * rr +
k2_ * rr * rr);
117 if (iteration >= maxIterations)
118 throw std::runtime_error(
119 "Cal3Bundler::calibrate fails to converge. need a better " 122 calibrateJacobians<Cal3Bundler, dimension>(*
this, pn, Dcal, Dp);
void print(const Matrix &A, const string &s, ostream &stream)
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &os, const Cal3Bundler &cal)
Output stream operator.
double k1() const
distorsion parameter k1
double distance2(const Point2 &p, const Point2 &q, OptionalJacobian< 1, 2 > H1, OptionalJacobian< 1, 2 > H2)
distance between two points
double k2() const
distorsion parameter k2
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Matrix3 K() const override
Standard 3*3 calibration matrix.
void g(const string &key, int i)
Point2 calibrate(const Point2 &pi, OptionalJacobian< 2, 3 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const
Matrix23 D2d_calibration(const Point2 &p) const
double tol_
tolerance value when calibrating
bool equals(const Cal3Bundler &K, double tol=10e-9) const
assert equality up to a tolerance
bool equals(const Cal3 &K, double tol=10e-9) const
Check if equal up to specified tolerance.
double v0_
principal point
double px() const
image center in x
typedef and functions to augment Eigen's VectorXd
ofstream os("timeSchurFactors.csv")
double fx() const
focal length x
double k2_
radial distortion
Annotation indicating that a class derives from another given type.
Matrix2 D2d_intrinsic(const Point2 &p) const
Vector4 k() const
Radial distortion parameters (4 of them, 2 0)
void print(const std::string &s="") const override
print with optional string
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
double py() const
image center in y
Calibration used by Bundler.
Matrix25 D2d_intrinsic_calibration(const Point2 &p) const
Point2 uncalibrate(const Point2 &p, OptionalJacobian< 2, 3 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const
: convert intrinsic coordinates xy to image coordinates uv Version of uncalibrate with derivatives ...