Apollo  6.0
Open source self driving car software
cropbox.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 
19 
20 namespace apollo {
21 namespace perception {
22 namespace camera {
23 
24 class IGetBox {
25  public:
26  virtual void getCropBox(const int width, const int height,
27  const base::TrafficLightPtr &light,
28  base::RectI *crop_box) = 0;
29 };
30 
31 class CropBox : public IGetBox {
32  public:
33  CropBox(float crop_scale, int min_crop_size);
34 
35  void Init(float crop_scale, int min_crop_size);
36 
37  virtual void getCropBox(const int width, const int height,
38  const base::TrafficLightPtr &light,
39  base::RectI *crop_box);
40 
41  private:
42  float crop_scale_ = 2.5f;
43  int min_crop_size_ = 270;
44 };
45 
46 class CropBoxWholeImage : public IGetBox {
47  public:
48  virtual void getCropBox(const int width, const int height,
49  const base::TrafficLightPtr &light,
50  base::RectI *crop_box);
51 };
52 
53 } // namespace camera
54 } // namespace perception
55 } // namespace apollo
virtual void getCropBox(const int width, const int height, const base::TrafficLightPtr &light, base::RectI *crop_box)=0
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: cropbox.h:24
std::shared_ptr< TrafficLight > TrafficLightPtr
Definition: traffic_light.h:88
Definition: cropbox.h:31
bool Init(const char *binary_name)