Apollo  6.0
Open source self driving car software
recognition.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 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
24 #include "modules/perception/camera/lib/traffic_light/detector/recognition/proto/recognition.pb.h"
26 
27 namespace apollo {
28 namespace perception {
29 namespace camera {
30 
32  public:
34 
36 
37  bool Init(const TrafficLightDetectorInitOptions& options) override;
38 
39  // @brief: detect traffic_light from image.
40  // @param [in]: options
41  // @param [in/out]: frame
42  // traffic_light type and 2D bbox should be filled, required,
43  bool Detect(const TrafficLightDetectorOptions& options,
44  CameraFrame* frame) override;
45 
46  std::string Name() const override;
47 
48  explicit TrafficLightRecognition(const BaseTrafficLightDetector&) = delete;
50 
51  private:
52  std::shared_ptr<ClassifyBySimple> classify_vertical_;
53  std::shared_ptr<ClassifyBySimple> classify_quadrate_;
54  std::shared_ptr<ClassifyBySimple> classify_horizontal_;
55  traffic_light::recognition::RecognizeBoxParam recognize_param_;
56 };
57 
58 } // namespace camera
59 } // namespace perception
60 } // namespace apollo
bool Detect(const TrafficLightDetectorOptions &options, CameraFrame *frame) override
Definition: camera_frame.h:33
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
TrafficLightRecognition()
Definition: recognition.h:33
Definition: base_traffic_light_detector.h:35
~TrafficLightRecognition()
Definition: recognition.h:35
Definition: base_traffic_light_detector.h:37
bool Init(const TrafficLightDetectorInitOptions &options) override
Definition: base_traffic_light_detector.h:31
TrafficLightRecognition & operator=(const BaseTrafficLightDetector &)=delete