DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Rectifier.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2015-2019 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
48 #ifndef DW_IMAGEPROCESSING_GEOMETRY_RECTIFIER_H_
49 #define DW_IMAGEPROCESSING_GEOMETRY_RECTIFIER_H_
50 
51 #include <dw/core/Context.h>
52 #include <dw/core/Types.h>
53 #include <dw/image/Image.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
64 typedef struct dwRectifierObject* dwRectifierHandle_t;
65 
82 dwStatus dwRectifier_initialize(dwRectifierHandle_t* obj,
83  dwCameraModelHandle_t cameraIn,
84  dwCameraModelHandle_t cameraOut,
85  dwContextHandle_t ctx);
86 
97 dwStatus dwRectifier_reset(dwRectifierHandle_t obj);
98 
111 dwStatus dwRectifier_release(dwRectifierHandle_t obj);
112 
130 dwStatus dwRectifier_warp(dwImageCUDA* outputImage, const dwImageCUDA* inputImage,
131  bool setOutsidePixelsToBlack, dwRectifierHandle_t obj);
132 
133 #ifdef VIBRANTE
134 
149 dwStatus dwRectifier_warpNvMedia(dwImageNvMedia* outputImage, const dwImageNvMedia* inputImage, dwRectifierHandle_t obj);
150 #endif
151 
168 dwStatus dwRectifier_warpROI(dwImageCUDA* outputImage, const dwImageCUDA* inputImage,
169  bool setOutsidePixelsToBlack, const dwRect roi, dwRectifierHandle_t obj);
170 
182 dwStatus dwRectifier_setHomography(const dwMatrix3f* homography, dwRectifierHandle_t obj);
183 
196 dwStatus dwRectifier_setHomographyFromRotation(float32_t roll, float32_t pitch, float32_t yaw, dwRectifierHandle_t obj);
197 
210 dwStatus dwRectifier_warpPointsCPU(dwVector2f* outputPoints, const dwVector2f* inputPoints,
211  uint32_t pointCount, dwRectifierHandle_t obj);
212 
225  uint32_t pointCount, dwRectifierHandle_t obj);
226 
240 dwStatus dwRectifier_warpPointsGPU(dwVector2f* outputPoints, const dwVector2f* inputPoints,
241  uint32_t pointCount, dwRectifierHandle_t obj);
242 
256  uint32_t pointCount, dwRectifierHandle_t obj);
257 
268 dwStatus dwRectifier_getHomography(dwMatrix3f* homography, dwRectifierHandle_t obj);
269 
280 dwStatus dwRectifier_setCUDAStream(cudaStream_t stream, dwRectifierHandle_t obj);
281 
292 dwStatus dwRectifier_getCUDAStream(cudaStream_t* stream, dwRectifierHandle_t obj);
293 
304 dwStatus dwRectifier_getDistortionMap(dwImageCUDA* distortionMap, dwRectifierHandle_t obj);
305 
306 #ifdef __cplusplus
307 }
308 #endif
309 
310 #endif // DW_RECTIFIER_H_
NVIDIA DriveWorks API: Camera Methods
Defines an NvMedia image.
Definition: Image.h:282
DW_API_PUBLIC dwStatus dwRectifier_getHomography(dwMatrix3f *homography, dwRectifierHandle_t obj)
Gets the homography matrix used.
DW_API_PUBLIC dwStatus dwRectifier_warpPointsInPlaceCPU(dwVector2f *points, uint32_t pointCount, dwRectifierHandle_t obj)
Warps an array of CPU dwVector2f and writes on the same buffer.
DW_API_PUBLIC dwStatus dwRectifier_initialize(dwRectifierHandle_t *obj, dwCameraModelHandle_t cameraIn, dwCameraModelHandle_t cameraOut, dwContextHandle_t ctx)
Initializes a rectifier based on an input and output camera model and a homography.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:70
DW_API_PUBLIC dwStatus dwRectifier_warpPointsGPU(dwVector2f *outputPoints, const dwVector2f *inputPoints, uint32_t pointCount, dwRectifierHandle_t obj)
Warps an array of dwVector2f on GPU.
DW_API_PUBLIC dwStatus dwRectifier_warpNvMedia(dwImageNvMedia *outputImage, const dwImageNvMedia *inputImage, dwRectifierHandle_t obj)
Warps the image from the input camera model to the model of the output camera using the Tegra VIC eng...
Defines a rectangle.
Definition: Types.h:189
DW_API_PUBLIC dwStatus dwRectifier_warpPointsCPU(dwVector2f *outputPoints, const dwVector2f *inputPoints, uint32_t pointCount, dwRectifierHandle_t obj)
Warps an array of CPU dwVector2f on a preallocated output CPU buffer.
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
DW_API_PUBLIC dwStatus dwRectifier_warpROI(dwImageCUDA *outputImage, const dwImageCUDA *inputImage, bool setOutsidePixelsToBlack, const dwRect roi, dwRectifierHandle_t obj)
Warps the image from the input camera model to the model of the output camera limiting the computatio...
Defines a CUDA image.
Definition: Image.h:266
DW_API_PUBLIC dwStatus dwRectifier_warpPointsInPlaceGPU(dwVector2f *points, uint32_t pointCount, dwRectifierHandle_t obj)
Warps an array of dwVector2f on the GPU and writes on the same buffer.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
DW_API_PUBLIC dwStatus dwRectifier_setCUDAStream(cudaStream_t stream, dwRectifierHandle_t obj)
Sets the CUDA stream used.
DW_API_PUBLIC dwStatus dwRectifier_getDistortionMap(dwImageCUDA *distortionMap, dwRectifierHandle_t obj)
Gets the distortion map as a 2-channel single plane image.
dwStatus
Status definition.
Definition: Status.h:166
DW_API_PUBLIC dwStatus dwRectifier_setHomographyFromRotation(float32_t roll, float32_t pitch, float32_t yaw, dwRectifierHandle_t obj)
Calculates and sets the homography matrix used based on a value for roll, pitch and yaw...
DW_API_PUBLIC dwStatus dwRectifier_warp(dwImageCUDA *outputImage, const dwImageCUDA *inputImage, bool setOutsidePixelsToBlack, dwRectifierHandle_t obj)
Warps the image from the input camera model to the model of the output camera using CUDA on the GPU...
Defines a 3x3 matrix of floating point numbers.
Definition: Types.h:237
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
struct dwCameraModelObject * dwCameraModelHandle_t
A pointer to the handle representing a calibrated camera model.
Definition: CameraModel.h:68
DW_API_PUBLIC dwStatus dwRectifier_getCUDAStream(cudaStream_t *stream, dwRectifierHandle_t obj)
Gets the CUDA stream used.
struct dwRectifierObject * dwRectifierHandle_t
A pointer to the handle representing a rectifier.
Definition: Rectifier.h:64
#define DW_API_PUBLIC
Definition: Exports.h:56
DW_API_PUBLIC dwStatus dwRectifier_release(dwRectifierHandle_t obj)
Releases the rectifier module.
DW_API_PUBLIC dwStatus dwRectifier_reset(dwRectifierHandle_t obj)
Resets the rectifier module.
DW_API_PUBLIC dwStatus dwRectifier_setHomography(const dwMatrix3f *homography, dwRectifierHandle_t obj)
Sets the homography matrix used.