DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

FreespaceDetector.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) 2017-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_FREESPACEDETECTOR_H_
49 #define DW_FREESPACEDETECTOR_H_
50 
51 #include <dw/core/Context.h>
52 #include <dw/core/Types.h>
53 #include <dw/image/Image.h>
54 #include <dw/rig/Rig.h>
56 #include <dw/dnn/DNN.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 #define DW_FREESPACE_IMAGE_MAX_COUNT 6
65 #define DW_FREESPACE_POINT_MAX_COUNT 960
66 
68 typedef struct
69 {
71 
74 
77 
80 
82 
84 typedef struct
85 {
88 
90  uint32_t frameWidth;
91 
93  uint32_t frameHeight;
94 
96  uint32_t maxNumImages
97  DW_DEPRECATED("This structure variable is deprecated and will be removed in the next major release.");
98 
100  cudaStream_t stream;
101 
104  DW_DEPRECATED("This structure variable is deprecated and will be removed in the next major release. Please consider "
105  "replacing it with cam_new");
106 
109 
112 
117 
119 
122 {
125 
128 
131 
134 
136  DW_DEPRECATED("This structure is deprecated and will be removed in the next major release. Please consider "
137  "replacing it with dwFreespaceDetectorInitParams");
138 
142 typedef struct dwFreespaceDetectorObject* dwFreespaceDetectorHandle_t;
143 
157 dwStatus dwFreespaceDetector_initializeFromOpenRoadNet(dwFreespaceDetectorHandle_t* obj,
158  dwOpenRoadNetHandle_t openroadnet,
159  uint32_t frameWidth,
160  uint32_t frameHeight,
161  cudaStream_t stream,
162  dwContextHandle_t ctx)
163  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
164  "replacing it with dwFreespaceDetector_initializeFromOpenRoadNet_new");
165 
176 dwStatus dwFreespaceDetector_initializeFromOpenRoadNet_new(dwFreespaceDetectorHandle_t* obj,
177  const dwFreespaceDetectorInitParams* initParams,
178  dwContextHandle_t ctx);
179 
192  const dwImageCUDA* frame,
193  dwFreespaceDetectorHandle_t obj);
194 
205  dwFreespaceDetectorHandle_t obj)
206  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
207  "replacing it with dwFreespaceDetector_initializeFromOpenRoadNet_release_2_2");
208 
219  dwFreespaceDetectorHandle_t obj)
220  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
221  "getting member RuntimeParams via the corresponding get APIs");
222 
232 dwStatus dwFreespaceDetector_setCameraHandle(dwCameraModelHandle_t cam, dwFreespaceDetectorHandle_t obj)
233  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
234  "setting calibrated cameras with dwFreespaceDetector_initializeFromOpenRoadNet_release_2_2");
235 
245 dwStatus dwFreespaceDetector_setCameraExtrinsics(dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj)
246  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
247  "setting calibrated cameras with dwFreespaceDetector_setCameraExtrinsics_new");
248 
259 dwStatus dwFreespaceDetector_setCameraExtrinsics_new(uint32_t imageIdx, dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj);
260 
271  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
272  "replacing it with dwFreespaceDetector_setMaxFreespaceDistance_new");
273 
284 dwStatus dwFreespaceDetector_setMaxFreespaceDistance_new(uint32_t imageIdx, float32_t maxDistance, dwFreespaceDetectorHandle_t obj);
285 
294 dwStatus dwFreespaceDetector_reset(dwFreespaceDetectorHandle_t obj);
295 
305 dwStatus dwFreespaceDetector_release(dwFreespaceDetectorHandle_t obj);
306 
316 dwStatus dwFreespaceDetector_processDeviceAsync(const dwImageCUDA* frame, dwFreespaceDetectorHandle_t obj)
317  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
318  "replacing it with dwFreespaceDetector_detectBoundary");
319 
329 dwStatus dwFreespaceDetector_interpretHost(dwFreespaceDetectorHandle_t obj)
330  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
331  "replacing it with dwFreespaceDetector_detectBoundary");
332 
345 dwStatus dwFreespaceDetector_getBoundaryDetection(dwFreespaceDetection* boundary, dwFreespaceDetectorHandle_t obj)
346  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
347  "replacing it with dwFreespaceDetector_detectBoundary");
348 
360 dwStatus dwFreespaceDetector_setCUDAStream(cudaStream_t stream, dwFreespaceDetectorHandle_t obj);
361 
372 dwStatus dwFreespaceDetector_getCUDAStream(cudaStream_t* stream, dwFreespaceDetectorHandle_t obj);
373 
384  dwFreespaceDetectorHandle_t obj)
385  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
386  "replacing it with dwFreespaceDetector_setDetectionROI_new");
387 
399  const dwRect* roi,
400  dwFreespaceDetectorHandle_t obj);
401 
411 dwStatus dwFreespaceDetector_getDetectionROI(dwRect* roi, dwFreespaceDetectorHandle_t obj)
412  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
413  "replacing it with dwFreespaceDetector_getDetectionROI_new");
414 
425 dwStatus dwFreespaceDetector_getDetectionROI_new(uint32_t imageIdx, dwRect* roi, dwFreespaceDetectorHandle_t obj);
426 
438 dwStatus dwFreespaceDetector_setTemporalSmoothFactor(float32_t factor, dwFreespaceDetectorHandle_t obj);
439 
451 dwStatus dwFreespaceDetector_setSpatialSmoothFilterWidth(uint32_t width, dwFreespaceDetectorHandle_t obj);
452 
462 dwStatus dwFreespaceDetector_getDNNMetaData(dwDNNMetaData* metaData, dwFreespaceDetectorHandle_t obj)
463  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
464  "replacing it with dwOpenRoadNet_getDNNMetaData");
465 
466 #ifdef __cplusplus
467 }
468 #endif
469 
470 #endif // DW_FREESPACEDETECTOR_H_
NVIDIA DriveWorks API: Camera Methods
DW_API_PUBLIC dwStatus dwFreespaceDetector_setDetectionROI(const dwRect *roi, dwFreespaceDetectorHandle_t obj)
Set the detection Region of Interest (ROI) for the detector.
NVIDIA DriveWorks API: OpenRoadNet Module
DW_API_PUBLIC dwStatus dwFreespaceDetector_reset(dwFreespaceDetectorHandle_t obj)
Resets the free space detector module.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:70
NVIDIA DriveWorks API: Rig Configuration
Defines a rectangle.
Definition: Types.h:189
DW_API_PUBLIC dwStatus dwFreespaceDetector_getCUDAStream(cudaStream_t *stream, dwFreespaceDetectorHandle_t obj)
Gets CUDA stream used by the free space detection.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setMaxFreespaceDistance_new(uint32_t imageIdx, float32_t maxDistance, dwFreespaceDetectorHandle_t obj)
Set the maximum distance in meters free space boundary can be detected for a specific camera image in...
struct dwOpenRoadNetObject * dwOpenRoadNetHandle_t
Handle to a OpenRoadNet object.
Definition: OpenRoadNet.h:62
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraHandle(dwCameraModelHandle_t cam, dwFreespaceDetectorHandle_t obj)
Set the handle to the calibrated camera.
DW_API_PUBLIC dwStatus dwFreespaceDetector_processDeviceAsync(const dwImageCUDA *frame, dwFreespaceDetectorHandle_t obj)
Processes the given frame on the GPU asynchronously.
Defines a CUDA image.
Definition: Image.h:266
DW_API_PUBLIC dwStatus dwFreespaceDetector_initializeFromOpenRoadNet(dwFreespaceDetectorHandle_t *obj, dwOpenRoadNetHandle_t openroadnet, uint32_t frameWidth, uint32_t frameHeight, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a free space detector module based on OpenRoadNet.
cudaStream_t stream
CUDA stream on which to perform all operations.
DW_API_PUBLIC dwStatus dwFreespaceDetector_getBoundaryDetection(dwFreespaceDetection *boundary, dwFreespaceDetectorHandle_t obj)
Gets the latest computed results.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraExtrinsics(dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj)
Set the transformation from camera to rig.
float32_t temporalSmoothingFactor
Temporal smooth factor, check dwFreespaceDetector_setTemporalSmoothFactor for more details...
DW_API_PUBLIC dwStatus dwFreespaceDetector_setRuntimeParams(const dwFreespaceDetectorRuntimeParams *rtParams, dwFreespaceDetectorHandle_t obj)
Set the runtime parameters associated with a free space detector module.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setTemporalSmoothFactor(float32_t factor, dwFreespaceDetectorHandle_t obj)
Set the temporal smoothing factor.
Specifies a 3D rigid transformation.
Definition: Types.h:462
Holds the free space detector runtime parameters.
uint32_t frameHeight
Height of camera frame when initialized without camera intrinsics, ignored if camera handle is valid...
NVIDIA DriveWorks API: DNN Methods
Holds the common free space detector initialization parameters.
dwStatus
Status definition.
Definition: Status.h:166
dwFreespaceBoundaryType
Category of free space boundary.
Definition: OpenRoadNet.h:65
uint32_t frameWidth
Width of camera frame when initialized without camera intrinsics, ignored if camera handle is valid...
Holds the definition of free space boundary in one image.
float32_t maxDistance
Maximum distance in meters at which free space boundary distance can be distinguished.
uint32_t spatialSmoothingWidth
Width of an 1-D Gaussian filter, check dwFreespaceDetector_setSpatialSmoothFilterWidth for more detai...
#define DW_DEPRECATED(msg)
Definition: Exports.h:68
DW_API_PUBLIC dwStatus dwFreespaceDetector_detectBoundary(dwFreespaceDetection *boundary, const dwImageCUDA *frame, dwFreespaceDetectorHandle_t obj)
Processes the given frame on the GPU asynchronously, runs the interpretation of the processed results...
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDNNMetaData(dwDNNMetaData *metaData, dwFreespaceDetectorHandle_t obj)
Returns the DNN metadata.
#define DW_FREESPACE_POINT_MAX_COUNT
DW_API_PUBLIC dwStatus dwFreespaceDetector_interpretHost(dwFreespaceDetectorHandle_t obj)
Runs the interpretation of the processed results on the CPU.
struct dwFreespaceDetectorObject * dwFreespaceDetectorHandle_t
Handle to a free space detector.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraExtrinsics_new(uint32_t imageIdx, dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj)
Set the camera to rig transformation for a specific camera image in the batch.
DW_API_PUBLIC dwStatus dwFreespaceDetector_getRuntimeParams(dwFreespaceDetectorRuntimeParams *rtParams, dwFreespaceDetectorHandle_t obj)
Get the runtime parameters associated with a free space detector module.
dwRect roi
Region Of Interest of frame to be processed by the detector.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setMaxFreespaceDistance(float32_t maxDistance, dwFreespaceDetectorHandle_t obj)
Set the maximum distance in meters at which free space boundary can be detected.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
Specifies TensorRT model header.
Definition: DNN.h:69
DW_API_PUBLIC dwStatus dwFreespaceDetector_setDetectionROI_new(uint32_t imageIdx, const dwRect *roi, dwFreespaceDetectorHandle_t obj)
Set the detection Region of Interest (ROI) for the detector.
struct dwCameraModelObject * dwCameraModelHandle_t
A pointer to the handle representing a calibrated camera model.
Definition: CameraModel.h:68
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDetectionROI_new(uint32_t imageIdx, dwRect *roi, dwFreespaceDetectorHandle_t obj)
Gets the detection Region of Interest (ROI) for the detector.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setSpatialSmoothFilterWidth(uint32_t width, dwFreespaceDetectorHandle_t obj)
Sets the spatial smoothing filter width.
DW_API_PUBLIC dwStatus dwFreespaceDetector_initializeFromOpenRoadNet_new(dwFreespaceDetectorHandle_t *obj, const dwFreespaceDetectorInitParams *initParams, dwContextHandle_t ctx)
Initializes a free space detector module based on OpenRoadNet.
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCUDAStream(cudaStream_t stream, dwFreespaceDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
dwOpenRoadNetHandle_t openroadnet
Specifies the handle to the OpenRoadNet module.
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDetectionROI(dwRect *roi, dwFreespaceDetectorHandle_t obj)
Gets the detection Region of Interest (ROI) for the detector.
#define DW_FREESPACE_IMAGE_MAX_COUNT
Maximum number of images to run free space detector on.
DW_API_PUBLIC dwStatus dwFreespaceDetector_release(dwFreespaceDetectorHandle_t obj)
Releases the detector module.
#define DW_API_PUBLIC
Definition: Exports.h:56