DriveWorks SDK Reference
3.5.78 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>
57 #include <dw/dnn/DNN.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
65 #define DW_FREESPACE_IMAGE_MAX_COUNT 6
66 #define DW_FREESPACE_POINT_MAX_COUNT 960
67 
69 typedef struct
70 {
72 
75 
78 
81 
84 
86  uint32_t sensorId;
88 
90 typedef struct
91 {
94 
96  uint32_t frameWidth;
97 
99  uint32_t frameHeight;
100 
102  uint32_t maxNumImages
103  DW_DEPRECATED("This structure variable is deprecated and will be removed in the next major release.");
104 
106  cudaStream_t stream;
107 
110  DW_DEPRECATED("This structure variable is deprecated and will be removed in the next major release. Please consider "
111  "replacing it with cam_new");
112 
115 
118 
123 
125  uint32_t sensorId[DW_FREESPACE_IMAGE_MAX_COUNT];
127 
130 {
133 
136 
139 
142 
144  DW_DEPRECATED("This structure is deprecated and will be removed in the next major release. Please consider "
145  "replacing it with dwFreespaceDetectorInitParams");
146 
150 typedef struct dwFreespaceDetectorObject* dwFreespaceDetectorHandle_t;
151 
163 dwStatus dwFreespaceDetector_initializeFromAutoNet(dwFreespaceDetectorHandle_t* obj,
164  dwAutoNetHandle_t autonet,
165  const dwFreespaceDetectorInitParams* initParams,
166  dwContextHandle_t ctx);
167 
181 dwStatus dwFreespaceDetector_initializeFromOpenRoadNet(dwFreespaceDetectorHandle_t* obj,
182  dwOpenRoadNetHandle_t openroadnet,
183  uint32_t frameWidth,
184  uint32_t frameHeight,
185  cudaStream_t stream,
186  dwContextHandle_t ctx)
187  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
188  "replacing it with dwFreespaceDetector_initializeFromOpenRoadNet_new");
189 
200 dwStatus dwFreespaceDetector_initializeFromOpenRoadNet_new(dwFreespaceDetectorHandle_t* obj,
201  const dwFreespaceDetectorInitParams* initParams,
202  dwContextHandle_t ctx);
203 
216  const dwImageCUDA* frame,
217  dwFreespaceDetectorHandle_t obj);
218 
233  dwFreespaceDetectorHandle_t obj);
234 
245  dwFreespaceDetectorHandle_t obj)
246  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
247  "replacing it with dwFreespaceDetector_initializeFromOpenRoadNet_release_2_2");
248 
259  dwFreespaceDetectorHandle_t obj)
260  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
261  "getting member RuntimeParams via the corresponding get APIs");
262 
272 dwStatus dwFreespaceDetector_setCameraHandle(dwCameraModelHandle_t cam, dwFreespaceDetectorHandle_t obj)
273  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
274  "setting calibrated cameras with dwFreespaceDetector_initializeFromOpenRoadNet_release_2_2");
275 
285 dwStatus dwFreespaceDetector_setCameraExtrinsics(dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj)
286  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
287  "setting calibrated cameras with dwFreespaceDetector_setCameraExtrinsics_new");
288 
299 dwStatus dwFreespaceDetector_setCameraExtrinsics_new(uint32_t imageIdx, dwTransformation3f cam2rig, dwFreespaceDetectorHandle_t obj);
300 
311  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
312  "replacing it with dwFreespaceDetector_setMaxFreespaceDistance_new");
313 
324 dwStatus dwFreespaceDetector_setMaxFreespaceDistance_new(uint32_t imageIdx, float32_t maxDistance, dwFreespaceDetectorHandle_t obj);
325 
334 dwStatus dwFreespaceDetector_reset(dwFreespaceDetectorHandle_t obj);
335 
345 dwStatus dwFreespaceDetector_release(dwFreespaceDetectorHandle_t obj);
346 
356 dwStatus dwFreespaceDetector_processDeviceAsync(const dwImageCUDA* frame, dwFreespaceDetectorHandle_t obj)
357  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
358  "replacing it with dwFreespaceDetector_detectBoundary");
359 
369 dwStatus dwFreespaceDetector_interpretHost(dwFreespaceDetectorHandle_t obj)
370  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
371  "replacing it with dwFreespaceDetector_detectBoundary");
372 
385 dwStatus dwFreespaceDetector_getBoundaryDetection(dwFreespaceDetection* boundary, dwFreespaceDetectorHandle_t obj)
386  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
387  "replacing it with dwFreespaceDetector_detectBoundary");
388 
400 dwStatus dwFreespaceDetector_setCUDAStream(cudaStream_t stream, dwFreespaceDetectorHandle_t obj);
401 
412 dwStatus dwFreespaceDetector_getCUDAStream(cudaStream_t* stream, dwFreespaceDetectorHandle_t obj);
413 
424  dwFreespaceDetectorHandle_t obj)
425  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
426  "replacing it with dwFreespaceDetector_setDetectionROI_new");
427 
439  const dwRect* roi,
440  dwFreespaceDetectorHandle_t obj);
441 
451 dwStatus dwFreespaceDetector_getDetectionROI(dwRect* roi, dwFreespaceDetectorHandle_t obj)
452  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
453  "replacing it with dwFreespaceDetector_getDetectionROI_new");
454 
465 dwStatus dwFreespaceDetector_getDetectionROI_new(uint32_t imageIdx, dwRect* roi, dwFreespaceDetectorHandle_t obj);
466 
478 dwStatus dwFreespaceDetector_setTemporalSmoothFactor(float32_t factor, dwFreespaceDetectorHandle_t obj);
479 
491 dwStatus dwFreespaceDetector_setSpatialSmoothFilterWidth(uint32_t width, dwFreespaceDetectorHandle_t obj);
492 
502 dwStatus dwFreespaceDetector_getDNNMetaData(dwDNNMetaData* metaData, dwFreespaceDetectorHandle_t obj)
503  DW_DEPRECATED("This API is deprecated and will be removed in the next major release. Please consider "
504  "replacing it with dwOpenRoadNet_getDNNMetaData");
505 
506 #ifdef __cplusplus
507 }
508 #endif
509 
510 #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.
dwTime_t timestamp
Timestamp of this detection in microseconds since the epoch.
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_detectBoundaryAutoNet(dwFreespaceDetection *boundary, dwAutoNetOutputHandle_t input, dwFreespaceDetectorHandle_t obj)
Detects boundaries from the given DNN inference output.
NVIDIA DriveWorks API: AutoNet Module
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_initializeFromAutoNet(dwFreespaceDetectorHandle_t *obj, dwAutoNetHandle_t autonet, const dwFreespaceDetectorInitParams *initParams, dwContextHandle_t ctx)
Initializes a free space detector module based on OpenRoadNet.
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:178
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...
uint32_t sensorId
Camera sensor ID.
Holds the definition of free space boundary in one image.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
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
struct dwAutoNetObject * dwAutoNetHandle_t
Handle to a AutoNet object.
Definition: AutoNet.h:65
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 dwAutoNetOutputObject * dwAutoNetOutputHandle_t
Handle to a AutoNet output object.
Definition: AutoNet.h:71
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