23 using namespace gtsam;
28 static Cal3_S2 K(500, 500, 0.1, 640 / 2, 480 / 2);
38 size_t w = 640,
h = 480;
47 Point2 expectedimage(1320.3, 1740);
106 Cal3_S2 K1(500, 500, 0.1, 640 / 2, 480 / 2);
126 Cal3_S2 k1(5, 5, 5, 5, 5), k2(5, 6, 7, 8, 9);
137 std::stringstream
os;
138 os <<
"fx: " << cal.
fx() <<
", fy: " << cal.
fy() <<
", s: " << cal.
skew()
139 <<
", px: " << cal.
px() <<
", py: " << cal.
py();
bool assert_stdout_equal(const std::string &expected, const V &actual)
Provides additional testing facilities for common data structures.
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Vector5 localCoordinates(const Cal3_S2 &T2) const
Unretraction for the calibration.
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
static Point2 p_uv(1320.3, 1740)
double py() const
image center in y
Point2 calibrate(const Point2 &p, OptionalJacobian< 2, 5 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
virtual size_t dim() const
return DOF, dimensionality of tangent space
Some functions to compute numerical derivatives.
static const Point3 pt(1.0, 2.0, 3.0)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
#define EXPECT(condition)
double fx() const
focal length x
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static Cal3_S2::shared_ptr K1(new Cal3_S2(fov, w, h))
The most common 5DOF 3D->2D calibration.
Cal3_S2 retract(const Vector &d) const
Given 5-dim tangent vector, create new calibration.
Point2 uncalibrate_(const Cal3_S2 &k, const Point2 &pt)
#define GTSAM_CONCEPT_MANIFOLD_INST(T)
#define EXPECT_LONGS_EQUAL(expected, actual)
ofstream os("timeSchurFactors.csv")
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
Point2 calibrate_(const Cal3_S2 &k, const Point2 &pt)
TEST(SmartFactorBase, Pinhole)
static size_t Dim()
return DOF, dimensionality of tangent space
Expression< T > between(const Expression< T > &t1, const Expression< T > &t2)
Cal3_S2 between(const Cal3_S2 &q, OptionalJacobian< 5, 5 > H1={}, OptionalJacobian< 5, 5 > H2={}) const
"Between", subtracts calibrations. between(p,q) == compose(inverse(p),q)
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
double fy() const
focal length y
#define GTSAM_CONCEPT_TESTABLE_INST(T)
The most common 5DOF 3D->2D calibration.
Point2 uncalibrate(const Point2 &p, OptionalJacobian< 2, 5 > Dcal={}, OptionalJacobian< 2, 2 > Dp={}) const
double px() const
image center in x