Apollo 11.0
自动驾驶开放平台
affine_transform.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
17#include <memory>
18#include <vector>
19#include <nppi.h>
20
21#include "opencv2/opencv.hpp"
22
24
26
27namespace apollo {
28namespace prediction {
29
31 public:
34
40 bool Init(cv::Size size, int type);
41
49 int GetCoeffs(const double heading,
50 const cv::Point2i& center_point,
51 const double scale,
52 double coeffs[2][3]);
53
62 int AffineTransformsFromMat(const cv::Mat& input_img,
63 const cv::Point2i& center_point,
64 const double heading,
65 const double scale,
66 cv::Mat* output_img);
67
68 private:
69 std::shared_ptr<CCObjectPool<unsigned char*>> src_pool_;
70 std::shared_ptr<CCObjectPool<unsigned char*>> out_pool_;
71 std::shared_ptr<CCObjectPool<NppStreamContext>> stream_pool_;
72 std::vector<void*> pointer_table_;
73 cv::Size size_;
74 int type_;
75};
76
77} // namespace prediction
78} // namespace apollo
79
int GetCoeffs(const double heading, const cv::Point2i &center_point, const double scale, double coeffs[2][3])
calculate the coeffs martix
int AffineTransformsFromMat(const cv::Mat &input_img, const cv::Point2i &center_point, const double heading, const double scale, cv::Mat *output_img)
perform the affine transform from cv mat
bool Init(cv::Size size, int type)
init function to the class
class register implement
Definition arena_queue.h:37