Cal3f.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 /* ----------------------------------------------------------------------------
12 
13  * GTSAM Copyright 2010
14  * See LICENSE for the license information
15 
16  * -------------------------------------------------------------------------- */
17 
24 #pragma once
25 
26 #include <gtsam/geometry/Cal3.h>
27 
28 namespace gtsam {
29 
35 class GTSAM_EXPORT Cal3f : public Cal3 {
36  public:
37  enum { dimension = 1 };
38  using shared_ptr = std::shared_ptr<Cal3f>;
39 
42 
44  Cal3f() = default;
45 
52  Cal3f(double f, double u0, double v0);
53 
54  ~Cal3f() override = default;
55 
59 
61  GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os, const Cal3f& cal);
62 
64  void print(const std::string& s = "") const override;
65 
67  bool equals(const Cal3f& K, double tol = 1e-9) const;
68 
72 
74  inline double f() const { return fx_; }
75 
77  Vector1 vector() const;
78 
88  OptionalJacobian<2, 2> Dp = {}) const;
89 
97  Point2 calibrate(const Point2& pi, OptionalJacobian<2, 1> Dcal = {},
98  OptionalJacobian<2, 2> Dp = {}) const;
99 
103 
105  size_t dim() const override { return Dim(); }
106 
108  inline static size_t Dim() { return dimension; }
109 
111  Cal3f retract(const Vector& d) const { return Cal3f(fx_ + d(0), u0_, v0_); }
112 
115  return Vector1(T2.fx_ - fx_);
116  }
117 
119 
120  private:
121 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
122 
123  friend class boost::serialization::access;
124  template <class Archive>
125  void serialize(Archive& ar, const unsigned int /*version*/) {
126  ar& BOOST_SERIALIZATION_NVP(fx_);
127  ar& BOOST_SERIALIZATION_NVP(u0_);
128  ar& BOOST_SERIALIZATION_NVP(v0_);
129  }
130 #endif
131 
133 };
134 
135 template <>
136 struct traits<Cal3f> : public internal::Manifold<Cal3f> {};
137 
138 template <>
139 struct traits<const Cal3f> : public internal::Manifold<Cal3f> {};
140 
141 } // namespace gtsam
gtsam::Vector1
Eigen::Matrix< double, 1, 1 > Vector1
Definition: Vector.h:41
gtsam::Cal3f::Dim
static size_t Dim()
Return DOF, dimensionality of tangent space.
Definition: Cal3f.h:108
s
RealScalar s
Definition: level1_cplx_impl.h:126
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
d
static const double d[K][N]
Definition: igam.h:11
gtsam::operator<<
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
Definition: testGroup.cpp:109
v0
static const double v0
Definition: testCal3DFisheye.cpp:31
Cal3.h
Common code for all Calibration models.
gtsam::Cal3f
Calibration model with a single focal length and zero skew.
Definition: Cal3f.h:35
gtsam::Cal3f::f
double f() const
focal length
Definition: Cal3f.h:74
gtsam::internal::Manifold
Both ManifoldTraits and Testable.
Definition: Manifold.h:117
os
ofstream os("timeSchurFactors.csv")
gtsam::Vector
Eigen::VectorXd Vector
Definition: Vector.h:38
fixture::cal
const Cal3_S2 cal(focalLength, focalLength, 0.0, principalPoint.x(), principalPoint.y())
gtsam::Cal3f::dim
size_t dim() const override
Return DOF, dimensionality of tangent space.
Definition: Cal3f.h:105
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
gtsam::Cal3f::retract
Cal3f retract(const Vector &d) const
Update calibration with tangent space delta.
Definition: Cal3f.h:111
gtsam::Cal3
Common base class for all calibration models.
Definition: Cal3.h:69
gtsam::Point2
Vector2 Point2
Definition: Point2.h:32
T2
static const Pose3 T2(Rot3::Rodrigues(0.3, 0.2, 0.1), P2)
gtsam::Cal3f::localCoordinates
Vector1 localCoordinates(const Cal3f &T2) const
Calculate local coordinates to another calibration.
Definition: Cal3f.h:114
gtsam::uncalibrate
Point2_ uncalibrate(const Expression< CALIBRATION > &K, const Point2_ &xy_hat)
Definition: slam/expressions.h:172
gtsam::equals
Definition: Testable.h:112
u0
static const double u0
Definition: testCal3DFisheye.cpp:31
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
gtsam
traits
Definition: SFMdata.h:40
gtsam::traits
Definition: Group.h:36
K
#define K
Definition: igam.h:8
gtsam::OptionalJacobian
Definition: OptionalJacobian.h:38
p
float * p
Definition: Tutorial_Map_using.cpp:9
gtsam::tol
const G double tol
Definition: Group.h:79
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
gtsam::Cal3::shared_ptr
std::shared_ptr< Cal3 > shared_ptr
Definition: Cal3.h:78


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:56