44 double k1_ = 0.0f, k2_ = 0.0f;
45 double p1_ = 0.0f, p2_ = 0.0f;
49 enum { dimension = 9 };
61 double k2,
double p1 = 0.0,
double p2 = 0.0,
double tol = 1
e-5)
62 :
Cal3(fx, fy, s, u0, v0),
76 :
Cal3(v(0), v(1), v(2), v(3), v(4)),
87 GTSAM_EXPORT
friend std::ostream&
operator<<(std::ostream&
os,
91 void print(
const std::string&
s =
"")
const override;
101 inline double k1()
const {
return k1_; }
104 inline double k2()
const {
return k2_; }
107 inline double p1()
const {
return p1_; }
110 inline double p2()
const {
return p2_; }
113 Vector4
k()
const {
return Vector4(k1_, k2_, p1_, p2_); }
116 Vector9 vector()
const;
133 Matrix2 D2d_intrinsic(
const Point2& p)
const;
136 Matrix29 D2d_calibration(
const Point2& p)
const;
139 size_t dim()
const override {
return Dim(); }
142 inline static size_t Dim() {
return dimension; }
149 virtual std::shared_ptr<Cal3DS2_Base>
clone()
const {
150 return std::shared_ptr<Cal3DS2_Base>(
new Cal3DS2_Base(*
this));
159 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 161 friend class boost::serialization::access;
162 template <
class Archive>
163 void serialize(Archive& ar,
const unsigned int ) {
164 ar& boost::serialization::make_nvp(
165 "Cal3DS2_Base", boost::serialization::base_object<Cal3>(*
this));
166 ar& BOOST_SERIALIZATION_NVP(k1_);
167 ar& BOOST_SERIALIZATION_NVP(k2_);
168 ar& BOOST_SERIALIZATION_NVP(p1_);
169 ar& BOOST_SERIALIZATION_NVP(p2_);
170 ar& BOOST_SERIALIZATION_NVP(tol_);
void print(const Matrix &A, const string &s, ostream &stream)
Vector4 k() const
return distortion parameter vector
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
static size_t Dim()
return DOF, dimensionality of tangent space
std::string serialize(const T &input)
serializes to a string
double p2() const
Second tangential distortion coefficient.
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Calibration of a camera with radial distortion.
Cal3DS2_Base(double fx, double fy, double s, double u0, double v0, double k1, double k2, double p1=0.0, double p2=0.0, double tol=1e-5)
size_t dim() const override
return DOF, dimensionality of tangent space
virtual std::shared_ptr< Cal3DS2_Base > clone() const
std::shared_ptr< Cal3 > shared_ptr
Common base class for all calibration models.
Array< int, Dynamic, 1 > v
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Common code for all Calibration models.
ofstream os("timeSchurFactors.csv")
Point2_ uncalibrate(const Expression< CALIBRATION > &K, const Point2_ &xy_hat)
double p1() const
First tangential distortion coefficient.
double k1() const
First distortion coefficient.
Cal3DS2_Base(const Vector9 &v)
double k2() const
Second distortion coefficient.