Go to the documentation of this file.
46 template <
typename Cal,
size_t Dim>
49 OptionalJacobian<2, 2> Dp = {}) {
52 Matrix22 H_uncal_pn, H_uncal_pn_inv;
55 calibration.uncalibrate(pn, Dcal ? &H_uncal_K :
nullptr, H_uncal_pn);
57 H_uncal_pn_inv = H_uncal_pn.inverse();
59 if (Dp) *Dp = H_uncal_pn_inv;
60 if (Dcal) *Dcal = -H_uncal_pn_inv * H_uncal_K;
71 double fx_ = 1.0f, fy_ = 1.0f;
73 double u0_ = 0.0f, v0_ = 0.0f;
76 enum { dimension = 5 };
88 : fx_(
fx), fy_(
fy), s_(
s), u0_(
u0), v0_(
v0) {}
92 : fx_(
d(0)), fy_(
d(1)), s_(
d(2)), u0_(
d(3)), v0_(
d(4)) {}
125 GTSAM_EXPORT
friend std::ostream&
operator<<(std::ostream&
os,
129 virtual void print(
const std::string&
s =
"")
const;
139 inline double fx()
const {
return fx_; }
142 inline double fy()
const {
return fy_; }
148 inline double skew()
const {
return s_; }
151 inline double px()
const {
return u0_; }
154 inline double py()
const {
return v0_; }
162 v << fx_, fy_, s_, u0_, v0_;
167 virtual Matrix3
K()
const {
169 K << fx_, s_, u0_, 0.0, fy_, v0_, 0.0, 0.0, 1.0;
177 inline virtual size_t dim()
const {
return Dim(); }
180 inline static size_t Dim() {
return dimension; }
187 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
188 friend class boost::serialization::access;
190 template <
class Archive>
191 void serialize(Archive& ar,
const unsigned int ) {
192 ar& BOOST_SERIALIZATION_NVP(fx_);
193 ar& BOOST_SERIALIZATION_NVP(fy_);
194 ar& BOOST_SERIALIZATION_NVP(s_);
195 ar& BOOST_SERIALIZATION_NVP(u0_);
196 ar& BOOST_SERIALIZATION_NVP(v0_);
double fy() const
focal length y
const EIGEN_DEVICE_FUNC InverseReturnType inverse() const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
double py() const
image center in y
ofstream os("timeSchurFactors.csv")
virtual size_t dim() const
return DOF, dimensionality of tangent space
const Cal3_S2 cal(focalLength, focalLength, 0.0, principalPoint.x(), principalPoint.y())
void calibrateJacobians(const Cal &calibration, const Point2 &pn, OptionalJacobian< 2, Dim > Dcal={}, OptionalJacobian< 2, 2 > Dp={})
void print(const Matrix &A, const string &s, ostream &stream)
Common base class for all calibration models.
virtual ~Cal3()
Virtual destructor.
virtual Matrix3 K() const
return calibration matrix K
double aspectRatio() const
aspect ratio
double fx() const
focal length x
Vector5 vector() const
vectorized form (column-wise)
Array< int, Dynamic, 1 > v
Cal3(double fx, double fy, double s, double u0, double v0)
constructor from doubles
Point2 principalPoint() const
return the principal point
The matrix class, also used for vectors and row-vectors.
double px() const
image center in x
std::shared_ptr< Cal3 > shared_ptr
Cal3(const Vector5 &d)
constructor from vector
static size_t Dim()
return DOF, dimensionality of tangent space
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:56