Apollo 11.0
自动驾驶开放平台
cropbox.h
浏览该文件的文档.
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
20namespace apollo {
21namespace perception {
22namespace trafficlight {
23
24class IGetBox {
25public:
34 virtual void getCropBox(
35 const int width,
36 const int height,
37 const base::TrafficLightPtr &light,
38 base::RectI *crop_box)
39 = 0;
40};
41
42class CropBox : public IGetBox {
43public:
50 CropBox(float crop_scale, int min_crop_size);
57 void Init(float crop_scale, int min_crop_size);
66 virtual void getCropBox(
67 const int width,
68 const int height,
69 const base::TrafficLightPtr &light,
70 base::RectI *crop_box);
71
72private:
73 float crop_scale_ = 2.5f;
74 int min_crop_size_ = 270;
75};
76
77class CropBoxWholeImage : public IGetBox {
78public:
87 virtual void getCropBox(
88 const int width,
89 const int height,
90 const base::TrafficLightPtr &light,
91 base::RectI *crop_box);
92};
93
94} // namespace trafficlight
95} // namespace perception
96} // namespace apollo
virtual void getCropBox(const int width, const int height, const base::TrafficLightPtr &light, base::RectI *crop_box)
Get the crop box object.
Definition cropbox.cc:84
virtual void getCropBox(const int width, const int height, const base::TrafficLightPtr &light, base::RectI *crop_box)
Get the crop box object.
Definition cropbox.cc:26
void Init(float crop_scale, int min_crop_size)
Initialize crop box object parameters.
Definition cropbox.cc:77
virtual void getCropBox(const int width, const int height, const base::TrafficLightPtr &light, base::RectI *crop_box)=0
Get the crop box object.
std::shared_ptr< TrafficLight > TrafficLightPtr
class register implement
Definition arena_queue.h:37