gtsam 4.2.0
gtsam
Loading...
Searching...
No Matches
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 <boost/optional.hpp>
24
25#include <Eigen/Core>
26#include <map>
27#include <vector>
28
29namespace gtsam {
30
31namespace gtsfm {
32
33typedef Eigen::MatrixX2i CorrespondenceIndices; // N x 2 array
34
35// Output of detections in an image.
36// Coordinate system convention:
37// 1. The x coordinate denotes the horizontal direction (+ve direction towards
38// the right).
39// 2. The y coordinate denotes the vertical direction (+ve direction downwards).
40// 3. Origin is at the top left corner of the image.
41struct Keypoints {
42 // The (x, y) coordinates of the features, of shape Nx2.
43 Eigen::MatrixX2d coordinates;
44
45 // Optional scale of the detections, of shape N.
46 // Note: gtsam::Vector is typedef'd for Eigen::VectorXd.
47 boost::optional<gtsam::Vector> scales;
48
50 boost::optional<gtsam::Vector> responses;
51
52 Keypoints(const Eigen::MatrixX2d& coordinates)
53 : coordinates(coordinates){}; // boost::none
54};
55
56using KeypointsVector = std::vector<Keypoints>;
57// Mapping from each image pair to (N,2) array representing indices of matching
58// keypoints.
59using MatchIndicesMap = std::map<IndexPair, CorrespondenceIndices>;
60
73std::vector<SfmTrack2d> tracksFromPairwiseMatches(
74 const MatchIndicesMap& matches, const KeypointsVector& keypoints,
75 bool verbose = false);
76
77} // namespace gtsfm
78
79} // 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:41
boost::optional< gtsam::Vector > responses
Optional confidences/responses for each detection, of shape N.
Definition DsfTrackGenerator.h:50