22#include <gtsam/base/VectorSpace.h>
23#if GTSAM_ENABLE_BOOST_SERIALIZATION
24#include <boost/serialization/nvp.hpp>
40 inline constexpr static auto dimension = 3;
46 uL_(0), uR_(0), v_(0) {
53 uL_(
uL), uR_(
uR), v_(
v) {
58 uL_(
v(0)), uR_(
v(1)), v_(
v(2)) {}
65 void print(
const std::string& s =
"")
const;
69 return (std::abs(uL_ - q.uL_) < tol && std::abs(uR_ - q.uR_) < tol
70 && std::abs(v_ - q.v_) < tol);
94 return StereoPoint2(uL_ + b.uL_, uR_ + b.uR_, v_ + b.v_);
99 return StereoPoint2(uL_ - b.uL_, uR_ - b.uR_, v_ - b.v_);
107 inline bool operator ==(
const StereoPoint2& q)
const {
return uL_== q.uL_ && uR_==q.uR_ && v_ == q.v_;}
110 inline double uL()
const {
return uL_;}
113 inline double uR()
const {
return uR_;}
116 inline double v()
const {
return v_;}
120 return Vector3(uL_, uR_, v_);
134 GTSAM_EXPORT
friend std::ostream &operator<<(std::ostream &os,
const StereoPoint2& p);
142#if GTSAM_ENABLE_BOOST_SERIALIZATION
144 friend class boost::serialization::access;
145 template<
class ARCHIVE>
146 void serialize(ARCHIVE & ar,
const unsigned int ) {
147 ar & BOOST_SERIALIZATION_NVP(uL_);
148 ar & BOOST_SERIALIZATION_NVP(uR_);
149 ar & BOOST_SERIALIZATION_NVP(v_);
157typedef std::vector<StereoPoint2> StereoPoint2Vector;
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
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:32
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
VectorSpace provides both Testable and VectorSpaceTraits.
Definition VectorSpace.h:221
A 2D stereo point, v will be same for rectified images.
Definition StereoPoint2.h:34
double uR() const
get uR
Definition StereoPoint2.h:113
StereoPoint2(const Vector3 &v)
construct from 3D vector
Definition StereoPoint2.h:57
Point2 right() const
convenient function to get a Point2 from the right image
Definition StereoPoint2.h:129
Vector3 vector() const
convert to vector
Definition StereoPoint2.h:119
double uL() const
get uL
Definition StereoPoint2.h:110
StereoPoint2(double uL, double uR, double v)
uL and uR represent the x-axis value of left and right frame coordinates respectively.
Definition StereoPoint2.h:52
bool equals(const StereoPoint2 &q, double tol=1e-9) const
equals
Definition StereoPoint2.h:68
StereoPoint2 operator-() const
inverse
Definition StereoPoint2.h:83
double v() const
get v
Definition StereoPoint2.h:116
Point2 point2() const
convenient function to get a Point2 from the left image
Definition StereoPoint2.h:124
static StereoPoint2 Identity()
identity
Definition StereoPoint2.h:78
StereoPoint2()
default constructor
Definition StereoPoint2.h:45