testSfmTrack.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
20 #include <gtsam/inference/Symbol.h>
22 #include <gtsam/sfm/SfmTrack.h>
23 
24 using namespace std;
25 using namespace gtsam;
26 
27 /* ************************************************************************* */
28 TEST(SfmTrack2d, defaultConstructor) {
29  SfmTrack2d track;
30  EXPECT_LONGS_EQUAL(0, track.measurements.size());
31  EXPECT_LONGS_EQUAL(0, track.siftIndices.size());
32 }
33 
34 /* ************************************************************************* */
35 TEST(SfmTrack2d, measurementConstructor) {
36  SfmTrack2d track({{0, Point2(1, 2)}, {1, Point2(3, 4)}});
37  EXPECT_LONGS_EQUAL(2, track.measurements.size());
38  EXPECT_LONGS_EQUAL(0, track.siftIndices.size());
39 }
40 
41 /* ************************************************************************* */
42 TEST(SfmTrack, construction) {
43  SfmTrack track(Point3(1, 2, 3), 4, 5, 6);
44  EXPECT(assert_equal(Point3(1, 2, 3), track.point3()));
45  EXPECT(assert_equal(Point3(4, 5, 6), track.rgb()));
46 }
47 
48 /* ************************************************************************* */
49 int main() {
50  TestResult tr;
51  return TestRegistry::runAllTests(tr);
52 }
53 /* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
EXPECT_LONGS_EQUAL
#define EXPECT_LONGS_EQUAL(expected, actual)
Definition: Test.h:154
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
TestHarness.h
gtsam::SfmTrack2d::measurements
std::vector< SfmMeasurement > measurements
The 2D image projections (id,(u,v))
Definition: SfmTrack.h:44
gtsam::SfmTrack2d
Track containing 2D measurements associated with a single 3D point. Note: Equivalent to gtsam....
Definition: SfmTrack.h:42
gtsam::SfmTrack::rgb
Point3 rgb() const
Get RGB values describing 3d point.
Definition: SfmTrack.h:147
gtsam::SfmTrack
Definition: SfmTrack.h:125
TEST
TEST(SfmTrack2d, defaultConstructor)
Definition: testSfmTrack.cpp:28
Symbol.h
gtsam::Point2
Vector2 Point2
Definition: Point2.h:32
gtsam::SfmTrack::point3
const Point3 & point3() const
Get 3D point.
Definition: SfmTrack.h:144
TestResult
Definition: TestResult.h:26
gtsam::SfmTrack2d::siftIndices
std::vector< SiftIndex > siftIndices
The feature descriptors (optional)
Definition: SfmTrack.h:47
gtsam
traits
Definition: SFMdata.h:40
NonlinearFactorGraph.h
Factor Graph consisting of non-linear factors.
std
Definition: BFloat16.h:88
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:41
gtsam::Point3
Vector3 Point3
Definition: Point3.h:38
main
int main()
Definition: testSfmTrack.cpp:49
SfmTrack.h
A simple data structure for a track in Structure from Motion.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:17:21