35 double fx_, fy_, s_, u0_, v0_;
38 enum { dimension = 5 };
46 fx_(1), fy_(1), s_(0), u0_(0), v0_(0) {
50 Cal3_S2(
double fx,
double fy,
double s,
double u0,
double v0) :
51 fx_(fx), fy_(fy), s_(s), u0_(u0), v0_(v0) {
56 fx_(d(0)), fy_(d(1)), s_(d(2)), u0_(d(3)), v0_(d(4)) {
65 Cal3_S2(
double fov,
int w,
int h);
72 Cal3_S2(
const std::string &path);
79 GTSAM_EXPORT
friend std::ostream &operator<<(std::ostream &os,
const Cal3_S2& cal);
82 void print(
const std::string& s =
"Cal3_S2")
const;
92 inline double fx()
const {
97 inline double fy()
const {
112 inline double px()
const {
117 inline double py()
const {
129 v << fx_, fy_, s_, u0_, v0_;
136 K << fx_, s_, u0_, 0.0, fy_, v0_, 0.0, 0.0, 1.0;
147 const double fxy = fx_ * fy_, sv0 = s_ * v0_, fyu0 = fy_ * u0_;
149 K_inverse << 1.0 / fx_, -s_ / fxy, (sv0 - fyu0) / fxy, 0.0,
150 1.0 / fy_, -v0_ / fy_, 0.0, 0.0, 1.0;
179 Vector3 calibrate(
const Vector3& p)
const;
187 return Cal3_S2(q.fx_-fx_, q.fy_-fy_, q.s_-s_, q.u0_-u0_, q.v0_-v0_);
196 inline size_t dim()
const {
207 return Cal3_S2(fx_ + d(0), fy_ + d(1), s_ + d(2), u0_ + d(3), v0_ + d(4));
212 return T2.
vector() - vector();
222 friend class boost::serialization::access;
223 template<
class Archive>
224 void serialize(Archive & ar,
const unsigned int ) {
225 ar & BOOST_SERIALIZATION_NVP(fx_);
226 ar & BOOST_SERIALIZATION_NVP(fy_);
227 ar & BOOST_SERIALIZATION_NVP(s_);
228 ar & BOOST_SERIALIZATION_NVP(u0_);
229 ar & BOOST_SERIALIZATION_NVP(v0_);
Cal3_S2(const Vector &d)
constructor from vector
Definition: Cal3_S2.h:55
double fx() const
focal length x
Definition: Cal3_S2.h:92
Vector5 vector() const
vectorized form (column-wise)
Definition: Cal3_S2.h:127
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
Cal3_S2(double fx, double fy, double s, double u0, double v0)
constructor from doubles
Definition: Cal3_S2.h:50
double py() const
image center in y
Definition: Cal3_S2.h:117
static size_t Dim()
return DOF, dimensionality of tangent space
Definition: Cal3_S2.h:201
Template to create a binary predicate.
Definition: Testable.h:110
double px() const
image center in x
Definition: Cal3_S2.h:112
double aspectRatio() const
aspect ratio
Definition: Cal3_S2.h:102
boost::shared_ptr< Cal3_S2 > shared_ptr
shared pointer to calibration object
Definition: Cal3_S2.h:39
Cal3_S2 retract(const Vector &d) const
Given 5-dim tangent vector, create new calibration.
Definition: Cal3_S2.h:206
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Cal3_S2()
Create a default calibration that leaves coordinates unchanged.
Definition: Cal3_S2.h:45
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Vector5 localCoordinates(const Cal3_S2 &T2) const
Unretraction for the calibration.
Definition: Cal3_S2.h:211
size_t dim() const
return DOF, dimensionality of tangent space
Definition: Cal3_S2.h:196
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Matrix3 K() const
return calibration matrix K
Definition: Cal3_S2.h:134
Matrix3 matrix_inverse() const
return inverted calibration matrix inv(K)
Definition: Cal3_S2.h:146
Cal3_S2 between(const Cal3_S2 &q, OptionalJacobian< 5, 5 > H1=boost::none, OptionalJacobian< 5, 5 > H2=boost::none) const
"Between", subtracts calibrations. between(p,q) == compose(inverse(p),q)
Definition: Cal3_S2.h:182
double fy() const
focal length y
Definition: Cal3_S2.h:97
double skew() const
skew
Definition: Cal3_S2.h:107
Point2 principalPoint() const
return the principal point
Definition: Cal3_S2.h:122
Matrix3 matrix() const
Definition: Cal3_S2.h:141