Skip to content

Commit

Permalink
Merge pull request #1316 from borglab/fix/track-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal authored Oct 26, 2022
2 parents 74133b2 + 3da27a5 commit 8b2639a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion gtsam/sfm/sfm.i
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class MatchIndicesMap {
size_t size() const;
bool empty() const;
void clear();
gtsam::gtsfm::CorrespondenceIndices at(const pair<size_t, size_t>& keypair) const;
gtsam::gtsfm::CorrespondenceIndices at(const gtsam::IndexPair& keypair) const;
};

class Keypoints {
Expand All @@ -350,6 +350,7 @@ class KeypointsVector {
gtsam::SfmTrack2dVector tracksFromPairwiseMatches(
const gtsam::gtsfm::MatchIndicesMap& matches_dict,
const gtsam::gtsfm::KeypointsVector& keypoints_list, bool verbose = false);

} // namespace gtsfm

} // namespace gtsam
7 changes: 4 additions & 3 deletions python/gtsam/tests/test_DsfTrackGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import gtsam
import numpy as np
from gtsam import IndexPair, KeypointsVector, MatchIndicesMap, Point2, SfmMeasurementVector, SfmTrack2d
from gtsam import (IndexPair, KeypointsVector, MatchIndicesMap, Point2,
SfmMeasurementVector, SfmTrack2d)
from gtsam.gtsfm import Keypoints
from gtsam.utils.test_case import GtsamTestCase

Expand Down Expand Up @@ -84,12 +85,12 @@ class TestSfmTrack2d(GtsamTestCase):
"""Tests for SfmTrack2d."""

def test_sfm_track_2d_constructor(self) -> None:
""" """
"""Test construction of 2D SfM track."""
measurements = SfmMeasurementVector()
measurements.append((0, Point2(10, 20)))
track = SfmTrack2d(measurements=measurements)
track.measurement(0)
track.numberMeasurements() == 1
assert track.numberMeasurements() == 1


if __name__ == "__main__":
Expand Down

0 comments on commit 8b2639a

Please # to comment.