Apollo 11.0
自动驾驶开放平台
undistortion_handler.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
18#include <string>
19
23
24namespace apollo {
25namespace perception {
26namespace camera {
27
29 public:
30 UndistortionHandler() { inited_ = false; }
31
33
34 bool set_device(int device);
35 bool Init(const std::string &sensor_name, int device);
36 void InitUndistortRectifyMap(const Eigen::Matrix3f &camera_model,
37 const Eigen::Matrix<float, 8, 1> &distortion,
38 const Eigen::Matrix3f &R,
39 const Eigen::Matrix3f &new_camera_model,
40 int width, int height, base::Blob<float> *d_mapx,
41 base::Blob<float> *d_mapy);
46 bool Handle(const base::Image8U &src_img, base::Image8U *dst_img);
47 // @brief: Release the resources
48 bool Release(void);
49
50 private:
51 base::Blob<float> d_mapx_;
52 base::Blob<float> d_mapy_;
53
54 int width_ = 0; // image cols
55 int height_ = 0; // image rows
56 int in_size_ = 0; // size of the input image in byte
57 int out_size_ = 0; // size of the output image in byte
58 int device_ = 0; // device number for gpu
59 bool inited_ = 0;
60};
61
62} // namespace camera
63} // namespace perception
64} // namespace apollo
A wrapper around SyncedMemory holders serving as the basic computational unit for images,...
Definition blob.h:88
A wrapper around Blob holders serving as the basic computational unit for images.
Definition image_8u.h:44
void InitUndistortRectifyMap(const Eigen::Matrix3f &camera_model, const Eigen::Matrix< float, 8, 1 > &distortion, const Eigen::Matrix3f &R, const Eigen::Matrix3f &new_camera_model, int width, int height, base::Blob< float > *d_mapx, base::Blob< float > *d_mapy)
bool Init(const std::string &sensor_name, int device)
bool Handle(const base::Image8U &src_img, base::Image8U *dst_img)
: Processing each image @params: src_img - input image array dst_img - output image array
first check imutoantoffset saved in device
Definition readme.txt:2
class register implement
Definition arena_queue.h:37