DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

PathDetector.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) 2018-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_PATHDETECTOR_H_
49 #define DW_PATHDETECTOR_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>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 #define DW_PATH_MAX_COUNT 8
65 #define DW_PATH_POINT_MAX_COUNT 128
66 
68 typedef struct dwPathNetPath
69 {
70 
73 
76 
82  uint32_t numPoints;
83 
86 
89 
92 
95 
98 
101 
104 
107 
108 } dwPathNetPath;
109 
111 typedef struct dwPathNetPath3D
112 {
113 
116 
119 
125  uint32_t numPoints;
126 
129 
132 
135 
138 
141 
144 
147 
150 
152 
154 typedef struct dwPathDetection
155 {
157  uint32_t numPathsImage;
158 
160  uint32_t numPathsWorld;
161 
164 
167 
170 
172 
174 {
178 
182 typedef struct dwPathDetectorObject* dwPathDetectorHandle_t;
183 
199 dwStatus dwPathDetector_initializeFromPathNet(dwPathDetectorHandle_t* obj,
200  dwPathNetHandle_t pathnet,
201  uint32_t frameWidth,
202  uint32_t frameHeight,
203  dwPathDetectorFoveaParams foveaParams,
204  cudaStream_t stream,
205  dwContextHandle_t ctx);
206 
226  dwPathNetHandle_t pathnet,
227  uint32_t frameWidth,
228  uint32_t frameHeight,
229  dwPathDetectorFoveaParams foveaParams,
231  dwTransformation3f cam2rig,
232  cudaStream_t stream,
233  dwContextHandle_t ctx);
234 
248 dwStatus dwPathDetector_initializeFromAutoNet(dwPathDetectorHandle_t* obj,
249  dwAutoNetHandle_t autonet,
250  uint32_t frameWidth,
251  uint32_t frameHeight,
252  cudaStream_t stream,
253  dwContextHandle_t ctx);
254 
265 dwStatus dwPathDetector_reset(dwPathDetectorHandle_t obj);
266 
277 dwStatus dwPathDetector_release(dwPathDetectorHandle_t obj);
278 
290 dwStatus dwPathDetector_processDeviceAsync(const dwImageCUDA* frame, dwPathDetectorHandle_t obj);
291 
305 dwStatus dwPathDetector_interpretHost(dwPathDetectorHandle_t obj);
306 
321 dwStatus dwPathDetector_getPathDetections(dwPathDetection* paths, dwPathDetectorHandle_t obj);
322 
335 dwStatus dwPathDetector_setCUDAStream(cudaStream_t stream, dwPathDetectorHandle_t obj);
336 
347 dwStatus dwPathDetector_getCUDAStream(cudaStream_t* stream, dwPathDetectorHandle_t obj);
348 
360  dwPathDetectorHandle_t obj);
361 
373 dwStatus dwPathDetector_setDetectionROI(const dwRect* roi, dwPathDetectorHandle_t obj);
374 
387 dwStatus dwPathDetector_getDetectionROI(dwRect* roi, dwPathDetectorHandle_t obj);
388 
401 dwStatus dwPathDetector_setDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj);
402 
415 dwStatus dwPathDetector_getDetectionThreshold(float32_t* threshold, dwPathDetectorHandle_t obj);
416 
429 dwStatus dwPathDetector_setOppositeTrafficDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj);
430 
443 dwStatus dwPathDetector_getOppositeTrafficDetectionThreshold(float32_t* threshold, dwPathDetectorHandle_t obj);
444 
459 dwStatus dwPathDetector_setTemporalSmoothingFactor(float32_t factor, dwPathDetectorHandle_t obj);
460 
474 dwStatus dwPathDetector_getTemporalSmoothingFactor(float32_t* factor, dwPathDetectorHandle_t obj);
475 
488 dwStatus dwPathDetector_getDNNMetaData(dwDNNMetaData* metaData, dwPathDetectorHandle_t obj);
489 
501 dwStatus dwPathDetector_setComputeCenterRailFrom3D(bool computeCenterRailFrom3D, dwPathDetectorHandle_t obj);
502 
514 dwStatus dwPathDetector_getComputeCenterRailFrom3D(bool* computeCenterRailFrom3D, dwPathDetectorHandle_t obj);
515 
526 dwStatus dwPathDetector_setUseFovea(bool useFovea, dwPathDetectorHandle_t obj);
527 
538 dwStatus dwPathDetector_getUseFovea(bool* useFovea, dwPathDetectorHandle_t obj);
539 
552 dwStatus dwPathDetector_detectPathsAutoNet(dwPathDetection* paths, dwAutoNetOutputHandle_t input, dwPathDetectorHandle_t obj);
553 
566  const dwImageCUDA* frame,
567  dwPathDetectorHandle_t obj);
568 
569 #ifdef __cplusplus
570 }
571 #endif
572 
573 #endif // DW_PATHDETECTOR_H_
NVIDIA DriveWorks API: Camera Methods
#define DW_PATH_MAX_COUNT
Definition: PathDetector.h:64
float32_t confidence
Confidence value of path.
Definition: PathDetector.h:85
DW_API_PUBLIC dwStatus dwPathDetector_getOppositeTrafficDetectionThreshold(float32_t *threshold, dwPathDetectorHandle_t obj)
Gets the opposite traffic path attribute confidence threshold for the PathNet based detector...
dwPathAttributeType pathAttributeType
Category of path attributes.
Definition: PathDetector.h:75
DW_API_PUBLIC dwStatus dwPathDetector_initializeFromAutoNet(dwPathDetectorHandle_t *obj, dwAutoNetHandle_t autonet, uint32_t frameWidth, uint32_t frameHeight, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a path detector module based on AutoNet.
float32_t confidence
Confidence value of path.
Definition: PathDetector.h:128
NVIDIA DriveWorks API: Core Types
Definition of one path in world coordinate system.
Definition: PathDetector.h:111
DW_API_PUBLIC dwStatus dwPathDetector_getCUDAStream(cudaStream_t *stream, dwPathDetectorHandle_t obj)
Gets CUDA stream used by the path detection.
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 dwPathDetector_getUseFovea(bool *useFovea, dwPathDetectorHandle_t obj)
Get fovea processing mode.
float32_t confidenceValues[DW_PATH_POINT_MAX_COUNT]
Array containing confidence value per point.
Definition: PathDetector.h:91
Defines a three-element floating-point vector.
Definition: Types.h:319
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
DW_API_PUBLIC dwStatus dwPathDetector_setCUDAStream(cudaStream_t stream, dwPathDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
DW_API_PUBLIC dwStatus dwPathDetector_release(dwPathDetectorHandle_t obj)
Releases the detector module.
DW_API_PUBLIC dwStatus dwPathDetector_initializeFromPathNet(dwPathDetectorHandle_t *obj, dwPathNetHandle_t pathnet, uint32_t frameWidth, uint32_t frameHeight, dwPathDetectorFoveaParams foveaParams, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a path detector module based on PathNet.
Output paths from post-processing.
Definition: PathDetector.h:154
Defines a CUDA image.
Definition: Image.h:266
dwVector2f rightEdgePoints[DW_PATH_POINT_MAX_COUNT]
Array containing path right edge locations.
Definition: PathDetector.h:97
DW_API_PUBLIC dwStatus dwPathDetector_reset(dwPathDetectorHandle_t obj)
Resets the path detector module.
NVIDIA DriveWorks API: AutoNet Module
DW_API_PUBLIC dwStatus dwPathDetector_detectPathsAutoNet(dwPathDetection *paths, dwAutoNetOutputHandle_t input, dwPathDetectorHandle_t obj)
Detects paths from the given DNN inference output.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
uint32_t numPathsImage
Total number of paths.
Definition: PathDetector.h:157
DW_API_PUBLIC dwStatus dwPathDetector_setOppositeTrafficDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj)
Sets the opposite traffic detection confidence threshold for the PathNet based detector.
dwVector2f centerRailPoints[DW_PATH_POINT_MAX_COUNT]
Array containing path center locations.
Definition: PathDetector.h:100
Specifies a 3D rigid transformation.
Definition: Types.h:462
NVIDIA DriveWorks API: DNN Methods
float32_t pathWidth[DW_PATH_POINT_MAX_COUNT]
Array containing width of center rail location.
Definition: PathDetector.h:103
float32_t pathAttributeConfidence
Confidence value of path attributes.
Definition: PathDetector.h:131
dwStatus
Status definition.
Definition: Status.h:178
DW_API_PUBLIC dwStatus dwPathDetector_getDNNMetaData(dwDNNMetaData *metaData, dwPathDetectorHandle_t obj)
Returns the DNN metadata.
struct dwPathNetObject * dwPathNetHandle_t
Handle to a PathNet object.
Definition: PathNet.h:62
DW_API_PUBLIC dwStatus dwPathDetector_setTemporalSmoothingFactor(float32_t factor, dwPathDetectorHandle_t obj)
Sets the temporal smoothing factor for the Path detector.
uint32_t numPoints
The total number of points that defines either right edge or left edge or center rail of each drive-a...
Definition: PathDetector.h:125
DW_API_PUBLIC dwStatus dwPathDetector_setCameraExtrinsics(const dwTransformation3f *cam2Rig, dwPathDetectorHandle_t obj)
Sets new calibrated camera extrinsic.
Definition of one path in image coordinate system.
Definition: PathDetector.h:68
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
DW_API_PUBLIC dwStatus dwPathDetector_setDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj)
Sets the detection confidence threshold for the PathNet based detector.
DW_API_PUBLIC dwStatus dwPathDetector_setUseFovea(bool useFovea, dwPathDetectorHandle_t obj)
Set fovea processing mode.
struct dwPathDetectorObject * dwPathDetectorHandle_t
Handle to path detector.
Definition: PathDetector.h:182
dwPathPositionType positionType
Category of path position.
Definition: PathDetector.h:115
dwPathAttributeType
Category of path attributes.
Definition: PathNet.h:79
DW_API_PUBLIC dwStatus dwPathDetector_interpretHost(dwPathDetectorHandle_t obj)
Runs the interpretation of the processed results on the CPU.
DW_API_PUBLIC dwStatus dwPathDetector_processDeviceAsync(const dwImageCUDA *frame, dwPathDetectorHandle_t obj)
Processes the given frame on the GPU asynchronously.
uint32_t numPathsWorld
Total number of valid paths in world coordinates.
Definition: PathDetector.h:160
dwPathPositionType positionType
Category of path position.
Definition: PathDetector.h:72
DW_API_PUBLIC dwStatus dwPathDetector_setDetectionROI(const dwRect *roi, dwPathDetectorHandle_t obj)
Set detection Region of Interest (ROI) for the detector.
DW_API_PUBLIC dwStatus dwPathDetector_getComputeCenterRailFrom3D(bool *computeCenterRailFrom3D, dwPathDetectorHandle_t obj)
Get the flag to compute 3D center rail from 3D path edges.
dwVector2f leftEdgePoints[DW_PATH_POINT_MAX_COUNT]
Array containing path left edge locations.
Definition: PathDetector.h:94
DW_API_PUBLIC dwStatus dwPathDetector_detectPaths(dwPathDetection *paths, const dwImageCUDA *frame, dwPathDetectorHandle_t obj)
Processes the given frame on the GPU asynchronously, runs the interpretation of the processed results...
DW_API_PUBLIC dwStatus dwPathDetector_getPathDetections(dwPathDetection *paths, dwPathDetectorHandle_t obj)
Gets the latest computed results in image coordinates.
dwPathPositionType
Category of path positions.
Definition: PathNet.h:65
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
Specifies TensorRT model header.
Definition: DNN.h:69
uint32_t numPoints
The total number of points that defines either right edge or left edge or center rail of each drive-a...
Definition: PathDetector.h:82
DW_API_PUBLIC dwStatus dwPathDetector_getDetectionThreshold(float32_t *threshold, dwPathDetectorHandle_t obj)
Gets the detection confidence threshold for the PathNet based detector.
struct dwAutoNetObject * dwAutoNetHandle_t
Handle to a AutoNet object.
Definition: AutoNet.h:65
#define DW_PATH_POINT_MAX_COUNT
Definition: PathDetector.h:65
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 dwPathDetector_getDetectionROI(dwRect *roi, dwPathDetectorHandle_t obj)
Get detection Region of Interest (ROI) for the detector.
DW_API_PUBLIC dwStatus dwPathDetector_getTemporalSmoothingFactor(float32_t *factor, dwPathDetectorHandle_t obj)
Gets the temporal smoothing factor from Path detector.
NVIDIA DriveWorks API: PathNet Module
DW_API_PUBLIC dwStatus dwPathDetector_setComputeCenterRailFrom3D(bool computeCenterRailFrom3D, dwPathDetectorHandle_t obj)
Set the flag to compute 3D center rail from 3D path edges.
#define DW_API_PUBLIC
Definition: Exports.h:56
float32_t pathAttributeConfidence
Confidence value of path attributes.
Definition: PathDetector.h:88
DW_API_PUBLIC dwStatus dwPathDetector_initializeFromPathNetWithCameraRig(dwPathDetectorHandle_t *obj, dwPathNetHandle_t pathnet, uint32_t frameWidth, uint32_t frameHeight, dwPathDetectorFoveaParams foveaParams, dwCameraModelHandle_t cam, dwTransformation3f cam2rig, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a path detector module based on PathNet with camera rig parameters.
dwPathAttributeType pathAttributeType
Category of path attributes.
Definition: PathDetector.h:118
float32_t pathAngle[DW_PATH_POINT_MAX_COUNT]
Array containing angle in degrees from center rail location.
Definition: PathDetector.h:106
dwTime_t timestamp
Timestamp of frame used for detection.
Definition: PathDetector.h:169