2 GTSAM Copyright 2010-2019, Georgia Tech Research Corporation, 3 Atlanta, Georgia 30332-0415 6 See LICENSE for the license information 8 Unit tests for testing dataset access. 9 Author: Frank Dellaert (Python: Sushmita Warrier) 13 from __future__
import print_function
24 """Tests for SfmData and SfmTrack modules.""" 27 """Initialize SfmData and SfmTrack""" 33 """Test functions in SfmTrack""" 42 self.tracks.add_measurement(i1, uv_i1)
43 self.tracks.add_measurement(i2, uv_i2)
45 self.assertEqual(self.tracks.number_measurements(), 2)
47 cam_idx, img_measurement = self.tracks.measurement(0)
48 self.assertEqual(cam_idx, i1)
49 np.testing.assert_array_almost_equal(
56 """Test functions in SfmData""" 64 measurements = [(i1, uv_i1), (i2, uv_i2), (i3, uv_i3)]
67 track2.add_measurement(i1, uv_i1)
68 track2.add_measurement(i2, uv_i2)
69 track2.add_measurement(i3, uv_i3)
70 self.data.add_track(self.
tracks)
71 self.data.add_track(track2)
73 self.assertEqual(self.data.number_tracks(), 2)
75 cam_idx, img_measurement = self.data.track(1).
measurement(0)
76 self.assertEqual(cam_idx, i1)
78 if __name__ ==
'__main__':
Define the structure for SfM data.
Define the structure for the 3D points.