Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for matlab wrapper in sfm.i #1316

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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