KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tracking_metrics.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Kyle Simek, Jinyan Guan, Ernesto Brau
17  * =========================================================================== */
18 
19 /* $Id: tracking_metrics.h 18005 2014-10-30 20:45:03Z ksimek $ */
20 
21 #ifndef TRACKING_METRICS_H
22 #define TRACKING_METRICS_H
23 
24 #include <m_cpp/m_matrix.h>
27 #include <boost/bimap.hpp>
28 #include <vector>
29 
30 namespace kjb {
31 namespace tracking {
32 
33 typedef boost::bimap<Entity_id, Entity_id> Correspondence;
34 
39 std::vector<Correspondence> get_correspondence
40 (
41  const Canonical_trajectory_map& gt_trajs,
42  const Canonical_trajectory_map& hyp_trajs,
43  double threshold = 1.0
44 );
45 
51 (
52  const std::vector<Correspondence>& corrs,
53  const Canonical_trajectory_map& gt_trajs,
54  const Canonical_trajectory_map& hyp_trajs,
55  double& mt,
56  double& ml,
57  size_t& frags,
58  size_t& id_switch
59 );
60 
65 (
66  const std::vector<size_t>& mme_ct,
67  const std::vector<size_t>& fp_ct,
68  const std::vector<size_t>& miss_ct,
69  const std::vector<size_t>& match_ct,
70  const std::vector<size_t>& obj_ct,
71  const std::vector<double>& dists,
72  double& mota,
73  double& motp
74 );
75 
81 (
82  std::vector<Entity_id>& ids,
83  std::vector<const Vector*>& points,
84  const Canonical_trajectory_map& trajs,
85  size_t cur_frame,
86  const Correspondence& existing_corr,
87  bool ground_truth
88 );
89 
94 void get_pw_distance
95 (
96  const std::vector<const Vector*>& pts1,
97  const std::vector<const Vector*>& pts2,
98  Matrix& distance
99 );
100 
105 (
106  const kjb::Matrix& pw_distance,
107  double threshold,
108  std::vector<std::pair<int, int> >& matching
109 );
110 
117 (
118  const std::vector<Correspondence>& corrs,
119  const Canonical_trajectory_map& gt_trajs,
120  const Canonical_trajectory_map& hyp_trajs,
121  std::vector<size_t>& mme_ct,
122  std::vector<size_t>& fp_ct,
123  std::vector<size_t>& miss_ct,
124  std::vector<size_t>& match_ct,
125  std::vector<size_t>& obj_ct,
126  std::vector<double>& dists
127 );
128 
129 }} // namespace kjb::tracking
130 
131 
132 #endif /* TRACKING_METRICS_H */
133 
Definition for the Matrix class, a thin wrapper on the KJB Matrix struct and its related functionalit...
std::vector< Correspondence > get_correspondence(const Canonical_trajectory_map &gt_trajs, const Canonical_trajectory_map &hyp_trajs, double threshold=1.0)
Compute the correspondence between the groud truth track and hypothesized tracks. ...
Definition: tracking_metrics.cpp:32
boost::bimap< Entity_id, Entity_id > Correspondence
Definition: tracking_metrics.h:33
void get_mt_ml_fragment_and_id_switch(const std::vector< Correspondence > &corrs, const Canonical_trajectory_map &gt_trajs, const Canonical_trajectory_map &hyp_trajs, double &mt, double &ml, size_t &frags, size_t &id_switch)
Compute most_tracked, most_lost and id_switches for a given correspondence.
Definition: tracking_metrics.cpp:137
void init_ids_and_points(std::vector< Entity_id > &ids, std::vector< const Vector * > &points, const Canonical_trajectory_map &trajs, size_t cur_frame, const Correspondence &existing_corr, bool ground_truth)
Extract unclaimed points for this time slice (ignores anything currently in exsiting correspondence) ...
Definition: tracking_metrics.cpp:259
void get_mota_and_motp(const std::vector< size_t > &mme_ct, const std::vector< size_t > &fp_ct, const std::vector< size_t > &miss_ct, const std::vector< size_t > &match_ct, const std::vector< size_t > &obj_ct, const std::vector< double > &dists, double &mota, double &motp)
Compute metrics based on the counts.
Definition: tracking_metrics.cpp:235
void get_best_matching(const kjb::Matrix &pw_distance, double threshold, std::vector< std::pair< int, int > > &matching)
Compute the best matching using hungarian algorithm.
Definition: tracking_metrics.cpp:331
Represents a set of trajectories; it is a map from entity to trajectory.
Definition: tracking_trajectory.h:53
void get_pw_distance(const std::vector< const Vector * > &pts1, const std::vector< const Vector * > &pts2, Matrix &distance)
Compute the pairwise distance between pts1 and pts2 and stores the results in Matrix distance...
Definition: tracking_metrics.cpp:303
This class implements matrices, in the linear-algebra sense, with real-valued elements.
Definition: m_matrix.h:94
struct memorypool points
Definition: triangle.c:637
void get_counts_and_distances(const std::vector< Correspondence > &corrs, const Canonical_trajectory_map &gt_trajs, const Canonical_trajectory_map &hyp_trajs, std::vector< size_t > &mme_ct, std::vector< size_t > &fp_ct, std::vector< size_t > &miss_ct, std::vector< size_t > &match_ct, std::vector< size_t > &obj_ct, std::vector< double > &dists)
Compute the counts (match, miss match, false positives, grouth truth objects, and the distance betwee...
Definition: tracking_metrics.cpp:359