43struct GTSAM_EXPORT SfmTrack2d {
54 SfmTrack2d() =
default;
57 explicit SfmTrack2d(
const std::vector<SfmMeasurement>&
measurements)
85 std::vector<int> track_cam_indices;
90 std::adjacent_find(track_cam_indices.begin(), track_cam_indices.end());
91 bool all_cameras_unique = (i == track_cam_indices.end());
92 return all_cameras_unique;
120using SfmTrack2dVector = std::vector<SfmTrack2d>;
126struct GTSAM_EXPORT SfmTrack : SfmTrack2d {
133 explicit SfmTrack(
float r = 0,
float g = 0,
float b = 0)
134 :
p(0, 0, 0), r(r), g(g),
b(
b) {}
138 : p(pt), r(r), g(g), b(b) {}
155 void print(
const std::string& s =
"")
const;
161#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
164 void GTSAM_DEPRECATED add_measurement(
size_t idx,
const gtsam::Point2& m) {
165 measurements.emplace_back(idx, m);
168 size_t GTSAM_DEPRECATED number_measurements()
const {
169 return measurements.size();
177 friend class boost::serialization::access;
178 template <
class ARCHIVE>
179 void serialize(ARCHIVE& ar,
const unsigned int ) {
180 ar& BOOST_SERIALIZATION_NVP(
p);
181 ar& BOOST_SERIALIZATION_NVP(r);
182 ar& BOOST_SERIALIZATION_NVP(g);
183 ar& BOOST_SERIALIZATION_NVP(
b);
Global functions in a separate testing namespace.
Definition chartTesting.h:28
std::pair< size_t, size_t > SiftIndex
Sift index for SfmTrack.
Definition SfmTrack.h:36
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
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
std::pair< size_t, Point2 > SfmMeasurement
A measurement with its camera index.
Definition SfmTrack.h:33
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:36
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
Template to create a binary predicate.
Definition Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:151
void addMeasurement(size_t idx, const gtsam::Point2 &m)
Add measurement (camera_idx, Point2) to track.
Definition SfmTrack.h:65
const SfmMeasurement & measurement(size_t idx) const
Get the measurement (camera index, Point2) at pose index idx.
Definition SfmTrack.h:73
std::vector< SiftIndex > siftIndices
The feature descriptors (optional).
Definition SfmTrack.h:48
const SiftIndex & siftIndex(size_t idx) const
Get the SIFT feature index corresponding to the measurement at idx.
Definition SfmTrack.h:78
bool hasUniqueCameras() const
Check that no two measurements are from the same camera.
Definition SfmTrack.h:84
Eigen::MatrixX2d measurementMatrix() const
Return the measurements as a 2D matrix.
Definition SfmTrack.h:100
size_t numberMeasurements() const
Total number of measurements in this track.
Definition SfmTrack.h:70
std::vector< SfmMeasurement > measurements
The 2D image projections (id,(u,v)).
Definition SfmTrack.h:45
Eigen::VectorXi indexVector() const
Return the camera indices of the measurements.
Definition SfmTrack.h:109
Definition SfmTrack.h:126
Point3 rgb() const
Get RGB values describing 3d point.
Definition SfmTrack.h:148
float b
RGB color of the 3D point.
Definition SfmTrack.h:128
const Point3 & point3() const
Get 3D point.
Definition SfmTrack.h:145
Point3 p
3D position of the point
Definition SfmTrack.h:127
Convenience functions for serializing data structures via boost.serialization.