Apollo 11.0
自动驾驶开放平台
camera_preprocess_general_util.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#pragma once
18
19#include <memory>
20#include <string>
21#include <vector>
22
23#include <opencv2/opencv.hpp>
24
25namespace apollo {
26namespace perception {
27namespace camera {
28
29cv::Mat GetImage(const std::string &path, bool to_rgb = false);
30
31void Resize(const cv::Mat &input_img, cv::Mat *out_img, cv::Size size,
32 double fx = 0, double fy = 0, int interpolation = cv::INTER_LINEAR);
33
34void Normalize(const std::vector<float> &mean, const std::vector<float> &std,
35 float scale, cv::Mat *img);
36
37std::vector<float> HWC2CHW(const cv::Mat &input_img);
38
39} // namespace camera
40} // namespace perception
41} // namespace apollo
void Resize(cv::Mat *img, cv::Mat *img_n, int width, int height)
Image resize function
Definition preprocess.cc:24
void Normalize(const std::vector< float > &mean, const std::vector< float > &std, float scale, cv::Mat *img)
Image normalize function
Definition preprocess.cc:33
cv::Mat GetImage(const std::string &path, bool to_rgb)
std::vector< float > HWC2CHW(const cv::Mat &input_img)
class register implement
Definition arena_queue.h:37
Definition future.h:29