Apollo  6.0
Open source self driving car software
denseline_lane_detector.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 
26 #include "modules/perception/camera/lib/lane/common/proto/denseline.pb.h"
29 
30 namespace apollo {
31 namespace perception {
32 namespace camera {
33 
35  public:
37  input_height_ = 0;
38  input_width_ = 0;
39  input_offset_y_ = 0;
40  input_offset_x_ = 0;
41  crop_height_ = 0;
42  crop_width_ = 0;
43  resize_height_ = 0;
44  resize_width_ = 0;
45  image_mean_[0] = 0;
46  image_mean_[1] = 0;
47  image_mean_[2] = 0;
48  image_scale_ = 0;
49  }
50 
52 
53  bool Init(const LaneDetectorInitOptions &options =
54  LaneDetectorInitOptions()) override;
55 
56  // @brief: detect lane from image.
57  // @param [in]: options
58  // @param [in/out]: frame
59  // detected lanes should be filled, required,
60  // 3D information of lane can be filled, optional.
61  bool Detect(const LaneDetectorOptions &options, CameraFrame *frame) override;
62  std::string Name() const override;
63 
64  private:
65  std::shared_ptr<inference::Inference> rt_net_ = nullptr;
66  std::shared_ptr<base::BaseCameraModel> base_camera_model_ = nullptr;
67  denseline::DenselineParam denseline_param_;
68  uint16_t input_height_;
69  uint16_t input_width_;
70  uint16_t input_offset_y_;
71  uint16_t input_offset_x_;
72  uint16_t crop_height_;
73  uint16_t crop_width_;
74  uint16_t resize_height_;
75  uint16_t resize_width_;
76  int image_mean_[3];
77  float image_scale_;
78 
79  DataProvider::ImageOptions data_provider_image_option_;
80  base::Image8U image_src_;
81  std::vector<std::string> net_inputs_;
82  std::vector<std::string> net_outputs_;
83 };
84 
85 } // namespace camera
86 } // namespace perception
87 } // namespace apollo
bool Init(const LaneDetectorInitOptions &options=LaneDetectorInitOptions()) override
Definition: camera_frame.h:33
DenselineLaneDetector()
Definition: denseline_lane_detector.h:36
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
A wrapper around Blob holders serving as the basic computational unit for images. ...
Definition: image_8u.h:44
bool Detect(const LaneDetectorOptions &options, CameraFrame *frame) override
Definition: base_lane_detector.h:37
Definition: base_lane_detector.h:35
Definition: denseline_lane_detector.h:34
virtual ~DenselineLaneDetector()
Definition: denseline_lane_detector.h:51
Definition: base_lane_detector.h:30