43 double k1_ = 0.0f, k2_ = 0.0f;
44 double p1_ = 0.0f, p2_ = 0.0f;
48 enum { dimension = 9 };
56 Cal3DS2_Base(
double fx,
double fy,
double s,
double u0,
double v0,
double k1,
57 double k2,
double p1 = 0.0,
double p2 = 0.0,
double tol = 1e-5)
58 :
Cal3(fx, fy, s, u0, v0),
71 Cal3DS2_Base(
const Vector9& v)
72 : Cal3(v(0), v(1), v(2), v(3), v(4)),
83 GTSAM_EXPORT
friend std::ostream& operator<<(std::ostream& os,
84 const Cal3DS2_Base& cal);
87 void print(
const std::string& s =
"")
const override;
90 bool equals(
const Cal3DS2_Base& K,
double tol = 1e-8)
const;
97 inline double k1()
const {
return k1_; }
100 inline double k2()
const {
return k2_; }
103 inline double p1()
const {
return p1_; }
106 inline double p2()
const {
return p2_; }
109 Vector4
k()
const {
return Vector4(k1_, k2_, p1_, p2_); }
112 Vector9 vector()
const;
129 Matrix2 D2d_intrinsic(
const Point2& p)
const;
132 Matrix29 D2d_calibration(
const Point2& p)
const;
135 size_t dim()
const override {
return Dim(); }
138 inline static size_t Dim() {
return dimension; }
145 virtual boost::shared_ptr<Cal3DS2_Base>
clone()
const {
146 return boost::shared_ptr<Cal3DS2_Base>(
new Cal3DS2_Base(*
this));
156 friend class boost::serialization::access;
157 template <
class Archive>
158 void serialize(Archive& ar,
const unsigned int ) {
159 ar& boost::serialization::make_nvp(
160 "Cal3DS2_Base", boost::serialization::base_object<Cal3>(*
this));
161 ar& BOOST_SERIALIZATION_NVP(k1_);
162 ar& BOOST_SERIALIZATION_NVP(k2_);
163 ar& BOOST_SERIALIZATION_NVP(p1_);
164 ar& BOOST_SERIALIZATION_NVP(p2_);
165 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:112
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
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
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Definition: Cal3DS2_Base.h:41
Cal3DS2_Base()=default
Default Constructor with only unit focal length.
double p2() const
Second tangential distortion coefficient.
Definition: Cal3DS2_Base.h:106
static size_t Dim()
return DOF, dimensionality of tangent space
Definition: Cal3DS2_Base.h:138
virtual boost::shared_ptr< Cal3DS2_Base > clone() const
Definition: Cal3DS2_Base.h:145
double k2() const
Second distortion coefficient.
Definition: Cal3DS2_Base.h:100
double k1() const
First distortion coefficient.
Definition: Cal3DS2_Base.h:97
size_t dim() const override
return DOF, dimensionality of tangent space
Definition: Cal3DS2_Base.h:135
double p1() const
First tangential distortion coefficient.
Definition: Cal3DS2_Base.h:103
Vector4 k() const
return distortion parameter vector
Definition: Cal3DS2_Base.h:109