26 using namespace gtsam;
31 static const
double fx = 250,
fy = 260,
s = 0.1,
u0 = 320,
v0 = 240;
32 static
Cal3Fisheye K(fx, fy, s, u0, v0, -0.013721808247486035,
33 0.020727425669427896, -0.012786476702685545,
34 0.0025242267320687625);
50 d << 1, 2, 3, 4, 5, 6, 7, 8, 9;
60 const double r =
sqrt(xi * xi + yi * yi);
61 const double t =
atan(r);
62 const double tt = t *
t, t4 = tt * tt, t6 = tt * t4, t8 = t4 * t4;
64 t * (1 +
K.
k1() * tt +
K.
k2() * t4 +
K.
k3() * t6 +
K.
k4() * t8);
65 Vector3 pd(td / r * xi, td / r * yi, 1);
68 Point2 uv_sol(v[0] / v[2], v[1] / v[2]);
135 Point2 xi(p3.x() / p3.z(), p3.y() / p3.z());
183 Point2 xi(p3.x() / p3.z(), p3.y() / p3.z());
184 Point2 uv(457.82638130304935, 408.18905848512986);
208 std::stringstream
os;
209 os <<
"fx: " << cal.
fx() <<
", fy: " << cal.
fy() <<
", s: " << cal.
skew()
210 <<
", px: " << cal.
px() <<
", py: " << cal.
py() <<
", k1: " << cal.
k1()
211 <<
", k2: " << cal.
k2() <<
", k3: " << cal.
k3() <<
", k4: " << cal.
k4();
bool assert_stdout_equal(const std::string &expected, const V &actual)
double fy() const
focal length y
Provides additional testing facilities for common data structures.
Point2 f(const Cal3Fisheye &k, const Point2 &pt)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
double k2() const
Second distortion coefficient.
static size_t Dim()
Return dimensions of calibration manifold object.
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Some functions to compute numerical derivatives.
double k4() const
Second tangential distortion coefficient.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const boost::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
static const Point3 pt(1.0, 2.0, 3.0)
double k1() const
First distortion coefficient.
virtual Matrix3 K() const
return calibration matrix K
Cal3Fisheye retract(const Vector &d) const
Given delta vector, update calibration.
Point2 calibrate(const Point2 &p, OptionalJacobian< 2, 9 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const
static Cal3Fisheye K(fx, fy, s, u0, v0,-0.013721808247486035, 0.020727425669427896,-0.012786476702685545, 0.0025242267320687625)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(boost::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
double py() const
image center in y
#define EXPECT(condition)
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Point2 calibrate_(const Cal3Fisheye &k, const Point2 &pt)
double k3() const
First tangential distortion coefficient.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Vector localCoordinates(const Cal3Fisheye &T2) const
Given a different calibration, calculate update to obtain it.
#define GTSAM_CONCEPT_MANIFOLD_INST(T)
#define EXPECT_LONGS_EQUAL(expected, actual)
ofstream os("timeSchurFactors.csv")
static Point2 kTestPoint2(2, 3)
TEST(LPInitSolver, InfiniteLoopSingleVar)
double px() const
image center in x
Point2 uncalibrate(const Point2 &p, OptionalJacobian< 2, 9 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const
convert intrinsic coordinates [x_i; y_i] to (distorted) image coordinates [u; v]
Calibration of a fisheye camera.
double fx() const
focal length x
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
#define GTSAM_CONCEPT_TESTABLE_INST(T)