34 double k1_ = 0.0f, k2_ = 0.0f;
42 enum { dimension = 3 };
45 using shared_ptr = boost::shared_ptr<Cal3Bundler>;
62 Cal3Bundler(
double f,
double k1,
double k2,
double u0 = 0,
double v0 = 0,
64 :
Cal3(f, f, 0, u0, v0), k1_(k1), k2_(k2), tol_(tol) {}
73 GTSAM_EXPORT
friend std::ostream& operator<<(std::ostream& os,
74 const Cal3Bundler& cal);
77 void print(
const std::string& s =
"")
const override;
80 bool equals(
const Cal3Bundler& K,
double tol = 10e-9)
const;
87 inline double k1()
const {
return k1_; }
90 inline double k2()
const {
return k2_; }
93 inline double px()
const {
return u0_; }
96 inline double py()
const {
return v0_; }
98 Matrix3 K()
const override;
101 Vector3 vector()
const;
103#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
105 inline double GTSAM_DEPRECATED u0()
const {
return u0_; }
108 inline double GTSAM_DEPRECATED v0()
const {
return v0_; }
119 Point2 uncalibrate(
const Point2& p, OptionalJacobian<2, 3> Dcal = boost::none,
120 OptionalJacobian<2, 2> Dp = boost::none)
const;
130 Point2 calibrate(
const Point2& pi, OptionalJacobian<2, 3> Dcal = boost::none,
131 OptionalJacobian<2, 2> Dp = boost::none)
const;
134 Matrix2 D2d_intrinsic(
const Point2& p)
const;
137 Matrix23 D2d_calibration(
const Point2& p)
const;
140 Matrix25 D2d_intrinsic_calibration(
const Point2& p)
const;
147 size_t dim()
const override {
return Dim(); }
150 inline static size_t Dim() {
return dimension; }
154 return Cal3Bundler(fx_ + d(0), k1_ + d(1), k2_ + d(2), u0_, v0_);
159 return T2.vector() - vector();
168 friend class boost::serialization::access;
169 template <
class Archive>
170 void serialize(Archive& ar,
const unsigned int ) {
171 ar& boost::serialization::make_nvp(
172 "Cal3Bundler", boost::serialization::base_object<Cal3>(*
this));
173 ar& BOOST_SERIALIZATION_NVP(k1_);
174 ar& BOOST_SERIALIZATION_NVP(k2_);
175 ar& BOOST_SERIALIZATION_NVP(tol_);
Common code for all Calibration models.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:113
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:156
Vector2 Point2
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point2 to Vector2...
Definition: Point2.h:27
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
Common base class for all calibration models.
Definition: Cal3.h:69
Calibration used by Bundler.
Definition: Cal3Bundler.h:32
double k1() const
distorsion parameter k1
Definition: Cal3Bundler.h:87
double k2() const
distorsion parameter k2
Definition: Cal3Bundler.h:90
Cal3Bundler()=default
Default constructor.
Cal3Bundler retract(const Vector &d) const
Update calibration with tangent space delta.
Definition: Cal3Bundler.h:153
double py() const
image center in y
Definition: Cal3Bundler.h:96
Cal3Bundler(double f, double k1, double k2, double u0=0, double v0=0, double tol=1e-5)
Constructor.
Definition: Cal3Bundler.h:62
Vector3 localCoordinates(const Cal3Bundler &T2) const
Calculate local coordinates to another calibration.
Definition: Cal3Bundler.h:158
double px() const
image center in x
Definition: Cal3Bundler.h:93
size_t dim() const override
return DOF, dimensionality of tangent space
Definition: Cal3Bundler.h:147
static size_t Dim()
return DOF, dimensionality of tangent space
Definition: Cal3Bundler.h:150