Apollo 11.0
自动驾驶开放平台
singlestage_transformer.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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
20#include "Eigen/Core"
21
22#include "modules/perception/camera_location_estimation/transformer/singlestage/proto/singlestage.pb.h"
23
26
27namespace apollo {
28namespace perception {
29namespace camera {
30
31// hyper parameters
42
44 public:
46 virtual ~SingleStageTransformer() = default;
47
55 bool Init(const TransformerInitOptions &options =
56 TransformerInitOptions()) override;
64 bool Transform(onboard::CameraFrame *frame) override;
65
66 std::string Name() const override { return "SingleStageTransformer"; }
67
68 private:
69 void FillResults(float object_center[3], float dimension_hwl[3],
70 float rotation_y, const Eigen::Affine3d &camera2world_pose,
71 float theta_ray, base::ObjectPtr obj);
72 float CenterPointFromBbox(const float *bbox, const float *hwl, float ry,
73 float *center, float *center2d, const float *k_mat,
74 int height, int width);
75 void ConstraintCenterPoint(const float *bbox, const float &z_ref,
76 const float &ry, const float *hwl,
77 const float *k_mat, float *center, float *x,
78 int height, int width);
79
80 private:
81 SinglestageParam singlestage_param_;
82 TransformerParams params_;
83};
84
85} // namespace camera
86} // namespace perception
87} // namespace apollo
bool Init(const TransformerInitOptions &options=TransformerInitOptions()) override
Init transformer by setting parameters
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
class register implement
Definition arena_queue.h:37