NVIDIA DeepStream SDK API Reference

9.2 Release
sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/postprocess/bbox3d_utils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef BBOX3D_UTILS_H
19 #define BBOX3D_UTILS_H
20 
21 #include <vector>
22 #include <cmath>
23 #include <iostream>
24 #include <torch/torch.h>
25 #include "../utils/log_utils.h"
26 #include "../utils/tensor.h"
27 
38  const torch::Tensor& bboxes3d,
39  const torch::Tensor& projection_matrices);
40 
63 torch::Tensor generate_bbox2d_from_rect3d(const torch::Tensor& rect3d,
64  int image_width,
65  int image_height);
66 
73 torch::Tensor box3d_to_corners(const torch::Tensor& box3d);
74 
81 #endif
PrettyLogger
Definition: sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/utils/log_utils.h:57
generate_bbox3d_on_camera_frames
torch::Tensor generate_bbox3d_on_camera_frames(const torch::Tensor &bboxes3d, const torch::Tensor &projection_matrices)
Converts 3D bounding boxes from world coordinates to camera coordinates.
test_generate_bbox3d_on_camera_frames
void test_generate_bbox3d_on_camera_frames(PrettyLogger *logger)
Test function to generate bbox3d on camera frames.
logger
Logger logger
box3d_to_corners
torch::Tensor box3d_to_corners(const torch::Tensor &box3d)
Converts 3D bounding box parameters to corner points in 3D space.
generate_bbox2d_from_rect3d
torch::Tensor generate_bbox2d_from_rect3d(const torch::Tensor &rect3d, int image_width, int image_height)
Generate 2D bounding boxes from projected 3D rectangle corners.