-
Notifications
You must be signed in to change notification settings - Fork 870
Expand file tree
/
Copy pathcamera_preprocess.hpp
More file actions
53 lines (45 loc) · 1.9 KB
/
camera_preprocess.hpp
File metadata and controls
53 lines (45 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2026 TIER IV
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef AUTOWARE__BEVFUSION__CAMERA__CAMERA_PREPROCESS_HPP_
#define AUTOWARE__BEVFUSION__CAMERA__CAMERA_PREPROCESS_HPP_
#include "autoware/bevfusion/utils.hpp"
#include <autoware/cuda_utils/cuda_check_error.hpp>
#include <cstdint>
namespace autoware::bevfusion
{
class CameraPreprocess
{
public:
CameraPreprocess(cudaStream_t stream, const int camera_id);
~CameraPreprocess();
cudaError_t resizeAndExtractRoi_launch(
const std::uint8_t * input_img, std::uint8_t * output_img, int H,
int W, // Original image dimensions
int H2, int W2, // Resized image dimensions
int H3, int W3, // ROI dimensions
int y_start, int x_start, // ROI top-left coordinates in resized image
bool flip_image_channels // Set to True if the image channels are to be flipped, for example,
// BGR to RGB
);
cudaError_t remap_launch(
const std::uint8_t * input_img, std::uint8_t * output_img, int output_height,
int output_width, // Output (destination) image dimensions
int input_height, int input_width, // Input (source) image dimensions
const float * map_x, const float * map_y);
private:
cudaStream_t stream_;
int camera_id_;
};
} // namespace autoware::bevfusion
#endif // AUTOWARE__BEVFUSION__CAMERA__CAMERA_PREPROCESS_HPP_