Apollo 11.0
自动驾驶开放平台
caddn_obstacle_detector.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <string>
19#include <vector>
20
21#include "modules/perception/camera_detection_single_stage/detector/caddn/proto/model_param.pb.h"
22
28
29namespace apollo {
30namespace perception {
31namespace camera {
32
34 public:
36 virtual ~CaddnObstacleDetector() = default;
44 bool Init(const ObstacleDetectorInitOptions &options =
53 bool Detect(onboard::CameraFrame *frame) override;
54
55 std::string Name() const override { return "CaddnObstacleDetector"; }
56
57 private:
58 bool InitTypes(const caddn::ModelParam &model_param);
59 void InitParam(const caddn::ModelParam &model_param);
60 void InitImageSize(const caddn::ModelParam &model_param);
61 bool Preprocess(const base::Image8U *image, base::BlobPtr<float> input_blob);
62
63 private:
64 caddn::ModelParam model_param_;
66 std::vector<base::ObjectSubType> types_;
67
68 int height_;
69 int width_;
70 float score_threshold_;
71
72 std::vector<float> lidar_to_cam_ = {
73 0.0048523, -0.9999298, -0.01081266, -0.00711321,
74 -0.00302069, 0.01079808, -0.99993706, -0.06176636,
75 0.99998367, 0.00488465, -0.00296808, -0.26739058,
76 0., 0., 0., 1.};
77};
78
79} // namespace camera
80} // namespace perception
81} // namespace apollo
A wrapper around Blob holders serving as the basic computational unit for images.
Definition image_8u.h:44
bool Detect(onboard::CameraFrame *frame) override
Main part to detect obstacle
std::string Name() const override
Interface for obstacle detector name
bool Init(const ObstacleDetectorInitOptions &options=ObstacleDetectorInitOptions()) override
Init function for CaddnObstacleDetector
std::shared_ptr< Blob< Dtype > > BlobPtr
Definition blob.h:313
class register implement
Definition arena_queue.h:37