Apollo  6.0
Open source self driving car software
frame_statistics.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 #pragma once
17 #include <algorithm>
18 #include <map>
19 #include <vector>
22 
23 namespace apollo {
24 namespace perception {
25 namespace benchmark {
26 
27 struct ObjectMatch {
28  unsigned int first; // groundtruth object id
29  unsigned int second; // detected object id
30  double jaccard_index;
32  unsigned int matched_point_num;
33  double confidence;
34 };
35 
36 class FrameStatistics : public Frame {
37  public:
38  bool find_association();
39  bool cal_meta_statistics();
40  const MetaStatistics& get_meta_statistics() const { return _meta_stat; }
41  double jaccard_index_percentile() const;
42 
43  public:
44  static void set_jaccard_index_threshold(double threshold);
45  static void set_jaccard_index_percentile(double percentile);
46  static double get_jaccard_index_percentile() {
47  return _s_jaccard_index_percentile;
48  }
49  static void set_roi_is_main_lanes(bool value);
50 
51  private:
52  // association data
53  std::vector<unsigned int> _isolated_object_indices_2017;
54  std::vector<unsigned int> _isolated_gt_object_indices_2017;
55  std::vector<unsigned int> _underseg_gt_object_indices_2017;
56  std::vector<unsigned int> _isolated_gt_object_indices_2016;
57  std::vector<ObjectMatch> _matches;
58  std::vector<unsigned int> _strict_match_indices;
59  std::vector<PositionMetric> _object_position;
60  std::vector<PositionMetric> _gt_object_position;
61  std::vector<OrientationSimilarityMetric> _orientation_similarity;
62  std::vector<double> _jaccard_indices;
63  PositionMetricOption _position_option;
64  // meta statistics data
65  MetaStatistics _meta_stat;
66 
67  private:
68  static double _s_jaccard_index_threshold;
69  static double _s_jaccard_index_percentile;
70  static double _s_cover_rate;
71  static bool _s_roi_is_main_lanes;
72 };
73 
74 } // namespace benchmark
75 } // namespace perception
76 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
double jaccard_index
Definition: frame_statistics.h:30
Definition: meta_statistics.h:62
unsigned int second
Definition: frame_statistics.h:29
double confidence
Definition: frame_statistics.h:33
const MetaStatistics & get_meta_statistics() const
Definition: frame_statistics.h:40
static double get_jaccard_index_percentile()
Definition: frame_statistics.h:46
Definition: frame_statistics.h:27
unsigned int matched_point_num
Definition: frame_statistics.h:32
unsigned int first
Definition: frame_statistics.h:28
apollo::cyber::base::std value
double jaccard_index_over_gt
Definition: frame_statistics.h:31
Definition: frame_statistics.h:36
Image< uchar > * threshold(Image< T > *src, int t)
Definition: imutil.h:63