Apollo  6.0
Open source self driving car software
region_output.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 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 
18 #include <algorithm>
19 #include <map>
20 #include <memory>
21 #include <string>
22 #include <utility>
23 #include <vector>
24 
31 #include "modules/perception/camera/lib/obstacle/detector/smoke/proto/smoke.pb.h"
32 
33 namespace apollo {
34 namespace perception {
35 namespace camera {
36 
38  float xmin = -1;
39  float ymin = -1;
40  float xmax = -1;
41  float ymax = -1;
42  int label = -1;
43  float score = -1;
44  float size = -1;
45  bool mask = false;
46 
48  return i.score < j.score;
49  }
50 };
51 
52 struct SmokeBBox3D {
53  float h = -1;
54  float w = -1;
55  float l = -1;
56  float alpha = -1;
57 };
58 
60  float w;
61  float h;
62 };
63 
64 struct SmokeNMSParam {
65  float threshold;
68  float sigma;
69  std::string type = "BoxVote";
70 };
71 
72 struct SmokeBlobs {
73  std::shared_ptr<base::Blob<float>> det1_loc_blob;
74 };
75 struct SmokeMinDims {
76  float min_2d_height = 0.0f;
77  float min_3d_height = 0.0f;
78  float min_3d_length = 0.0f;
79  float min_3d_width = 0.0f;
80 };
81 
83 
84 void get_smoke_objects_cpu(const SmokeBlobs &smoke_blobs,
85  const std::vector<base::ObjectSubType> &types,
86  const smoke::ModelParam &model_param,
87  float light_vis_conf_threshold,
88  float light_swt_conf_threshold,
89  base::Blob<bool> *overlapped, base::Blob<int> *idx_sm,
90  std::vector<base::ObjectPtr> *objects,
91  int width, int height);
92 
93 void recover_smoke_bbox(int roi_w, int roi_h, int offset_y,
94  std::vector<base::ObjectPtr> *objects);
95 
96 void filter_bbox(const SmokeMinDims &min_dims,
97  std::vector<base::ObjectPtr> *objects);
98 
99 void fill_smoke_base(base::ObjectPtr obj, const float *bbox,
100  int width, int height);
101 void fill_smoke_bbox3d(bool with_bbox3d, base::ObjectPtr obj,
102  const float *bbox);
104 
105 } // namespace camera
106 } // namespace perception
107 } // namespace apollo
int label
Definition: region_output.h:42
float inter_cls_conf_thresh
Definition: region_output.h:67
void filter_bbox(const SmokeMinDims &min_dims, std::vector< base::ObjectPtr > *objects)
float xmax
Definition: region_output.h:40
base::ObjectSubType get_smoke_object_subtype(int cls)
void fill_smoke_base(base::ObjectPtr obj, const float *bbox, int width, int height)
Definition: region_output.h:59
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool mask
Definition: region_output.h:45
void fill_smoke_bbox3d(bool with_bbox3d, base::ObjectPtr obj, const float *bbox)
float sigma
Definition: region_output.h:68
float w
Definition: region_output.h:60
float inter_cls_nms_thresh
Definition: region_output.h:66
float score
Definition: region_output.h:43
float threshold
Definition: region_output.h:65
bool operator()(SmokeNormalizedBBox i, SmokeNormalizedBBox j)
Definition: region_output.h:47
A wrapper around SyncedMemory holders serving as the basic computational unit for images...
Definition: blob.h:88
void get_smoke_objects_cpu(const SmokeBlobs &smoke_blobs, const std::vector< base::ObjectSubType > &types, const smoke::ModelParam &model_param, float light_vis_conf_threshold, float light_swt_conf_threshold, base::Blob< bool > *overlapped, base::Blob< int > *idx_sm, std::vector< base::ObjectPtr > *objects, int width, int height)
Definition: region_output.h:64
std::shared_ptr< base::Blob< float > > det1_loc_blob
Definition: region_output.h:73
Definition: region_output.h:52
float ymin
Definition: region_output.h:39
float xmin
Definition: region_output.h:38
float size
Definition: region_output.h:44
void recover_smoke_bbox(int roi_w, int roi_h, int offset_y, std::vector< base::ObjectPtr > *objects)
Definition: region_output.h:75
ObjectSubType
Definition: object_types.h:63
Definition: region_output.h:72
float ymax
Definition: region_output.h:41
std::shared_ptr< Object > ObjectPtr
Definition: object.h:123
float h
Definition: region_output.h:61