gtsam 4.2.0
gtsam
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
28namespace gtsam {
29
30namespace gtsfm {
31
32typedef 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.
40struct 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 boost::optional<gtsam::Vector> scales;
47
49 boost::optional<gtsam::Vector> responses;
50
51 Keypoints(const Eigen::MatrixX2d& coordinates)
52 : coordinates(coordinates){}; // boost::none
53};
54
55using KeypointsVector = std::vector<Keypoints>;
56// Mapping from each image pair to (N,2) array representing indices of matching
57// keypoints.
58using MatchIndicesMap = std::map<IndexPair, CorrespondenceIndices>;
59
72std::vector<SfmTrack2d> tracksFromPairwiseMatches(
73 const MatchIndicesMap& matches, const KeypointsVector& keypoints,
74 bool verbose = false);
75
76} // namespace gtsfm
77
78} // namespace gtsam
Allow for arbitrary type in DSF.
A simple data structure for a track in Structure from Motion.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Definition: DsfTrackGenerator.h:40
boost::optional< gtsam::Vector > responses
Optional confidences/responses for each detection, of shape N.
Definition: DsfTrackGenerator.h:49