Loading...
Searching...
No Matches
Cal3_S2.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/geometry/Cal3.h>
#include <gtsam/geometry/Point2.h>
namespace gtsam {
class GTSAM_EXPORT Cal3_S2 : public Cal3 {
public:
enum { dimension = 5 };
using shared_ptr = boost::shared_ptr<Cal3_S2>;
Cal3_S2() = default;
Cal3_S2(double fx, double fy, double s, double u0, double v0)
: Cal3(fx, fy, s, u0, v0) {}
Cal3_S2(const Vector5& d) : Cal3(d) {}
Cal3_S2(double fov, int w, int h) : Cal3(fov, w, h) {}
Point2 uncalibrate(const Point2& p, OptionalJacobian<2, 5> Dcal = boost::none,
OptionalJacobian<2, 2> Dp = boost::none) const;
Point2 calibrate(const Point2& p, OptionalJacobian<2, 5> Dcal = boost::none,
OptionalJacobian<2, 2> Dp = boost::none) const;
Vector3 calibrate(const Vector3& p) const;
GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os,
const Cal3_S2& cal);
void print(const std::string& s = "Cal3_S2") const override;
bool equals(const Cal3_S2& K, double tol = 10e-9) const;
inline Cal3_S2 between(const Cal3_S2& q,
OptionalJacobian<5, 5> H1 = boost::none,
OptionalJacobian<5, 5> H2 = boost::none) const {
if (H1) *H1 = -I_5x5;
if (H2) *H2 = I_5x5;
return Cal3_S2(q.fx_ - fx_, q.fy_ - fy_, q.s_ - s_, q.u0_ - u0_,
q.v0_ - v0_);
}
inline static size_t Dim() { return dimension; }
inline Cal3_S2 retract(const Vector& d) const {
return Cal3_S2(fx_ + d(0), fy_ + d(1), s_ + d(2), u0_ + d(3), v0_ + d(4));
}
Vector5 localCoordinates(const Cal3_S2& T2) const {
return T2.vector() - vector();
}
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int /*version*/) {
ar& boost::serialization::make_nvp(
"Cal3_S2", boost::serialization::base_object<Cal3>(*this));
}
};
template <>
struct traits<Cal3_S2> : public internal::Manifold<Cal3_S2> {};
template <>
struct traits<const Cal3_S2> : public internal::Manifold<Cal3_S2> {};
} // \ namespace gtsam
Cal3.h
Common code for all Calibration models.
Point2.h
2D Point
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
gtsam::Point2
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
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
gtsam::internal::Manifold
Both ManifoldTraits and Testable.
Definition Manifold.h:120
gtsam::OptionalJacobian
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition OptionalJacobian.h:41
gtsam::equals
Template to create a binary predicate.
Definition Testable.h:111
gtsam::Cal3::vector
Vector5 vector() const
vectorized form (column-wise)
Definition Cal3.h:160
gtsam::Cal3::Cal3
Cal3()=default
Create a default calibration that leaves coordinates unchanged.
gtsam::Cal3::fy_
double fy_
focal length
Definition Cal3.h:71
gtsam::Cal3::s_
double s_
skew
Definition Cal3.h:72
gtsam::Cal3::fx
double fx() const
focal length x
Definition Cal3.h:139
gtsam::Cal3::v0_
double v0_
principal point
Definition Cal3.h:73
gtsam::Cal3::fy
double fy() const
focal length y
Definition Cal3.h:142
gtsam::Cal3_S2
The most common 5DOF 3D->2D calibration.
Definition Cal3_S2.h:34
gtsam::Cal3_S2::Cal3_S2
Cal3_S2()=default
Create a default calibration that leaves coordinates unchanged.
gtsam::Cal3_S2::Cal3_S2
Cal3_S2(double fx, double fy, double s, double u0, double v0)
constructor from doubles
Definition Cal3_S2.h:48
gtsam::Cal3_S2::between
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:104
gtsam::Cal3_S2::Dim
static size_t Dim()
return DOF, dimensionality of tangent space
Definition Cal3_S2.h:118
gtsam::Cal3_S2::Cal3_S2
Cal3_S2(const Vector5 &d)
constructor from vector
Definition Cal3_S2.h:52
gtsam::Cal3_S2::localCoordinates
Vector5 localCoordinates(const Cal3_S2 &T2) const
Unretraction for the calibration.
Definition Cal3_S2.h:126
gtsam::Cal3_S2::Cal3_S2
Cal3_S2(double fov, int w, int h)
Easy constructor, takes fov in degrees, asssumes zero skew, unit aspect.
Definition Cal3_S2.h:60
gtsam::Cal3_S2::retract
Cal3_S2 retract(const Vector &d) const
Given 5-dim tangent vector, create new calibration.
Definition Cal3_S2.h:121