DsfTrackGenerator.h
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 
19 #pragma once
20 #include <gtsam/base/DSFMap.h>
21 #include <gtsam/sfm/SfmTrack.h>
22 
23 #include <Eigen/Core>
24 #include <map>
25 #include <optional>
26 #include <vector>
27 
28 namespace gtsam {
29 
30 namespace gtsfm {
31 
32 typedef Eigen::MatrixX2i CorrespondenceIndices; // N x 2 array
33 
34 // Output of detections in an image.
35 // Coordinate system convention:
36 // 1. The x coordinate denotes the horizontal direction (+ve direction towards
37 // the right).
38 // 2. The y coordinate denotes the vertical direction (+ve direction downwards).
39 // 3. Origin is at the top left corner of the image.
40 struct Keypoints {
41  // The (x, y) coordinates of the features, of shape Nx2.
42  Eigen::MatrixX2d coordinates;
43 
44  // Optional scale of the detections, of shape N.
45  // Note: gtsam::Vector is typedef'd for Eigen::VectorXd.
46  std::optional<gtsam::Vector> scales;
47 
49  std::optional<gtsam::Vector> responses;
50 
51  Keypoints(const Eigen::MatrixX2d &_coordinates)
52  : coordinates(_coordinates) {}
53 };
54 
55 using KeypointsVector = std::vector<Keypoints>;
56 // Mapping from each image pair to (N,2) array representing indices of matching
57 // keypoints.
58 using MatchIndicesMap = std::map<IndexPair, CorrespondenceIndices>;
59 
72 std::vector<SfmTrack2d> tracksFromPairwiseMatches(
73  const MatchIndicesMap& matches, const KeypointsVector& keypoints,
74  bool verbose = false);
75 
76 } // namespace gtsfm
77 
78 } // namespace gtsam
Keypoints(const Eigen::MatrixX2d &_coordinates)
std::optional< gtsam::Vector > responses
Optional confidences/responses for each detection, of shape N.
A simple data structure for a track in Structure from Motion.
std::map< IndexPair, CorrespondenceIndices > MatchIndicesMap
Eigen::MatrixX2d coordinates
std::optional< gtsam::Vector > scales
std::vector< SfmTrack2d > tracksFromPairwiseMatches(const MatchIndicesMap &matches, const KeypointsVector &keypoints, bool verbose)
Creates a list of tracks from 2d point correspondences.
Eigen::MatrixX2i CorrespondenceIndices
std::vector< Keypoints > KeypointsVector
traits
Definition: chartTesting.h:28
Allow for arbitrary type in DSF.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:11