DriveWorks SDK Reference
3.0.4260 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>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #define DW_PATH_MAX_COUNT 8
64 #define DW_PATH_POINT_MAX_COUNT 128
65 
67 typedef struct dwPathNetPath
68 {
69 
72 
75 
81  uint32_t numPoints;
82 
85 
88 
91 
94 
97 
100 
103 
106 
107 } dwPathNetPath;
108 
110 typedef struct dwPathNetPath3D
111 {
112 
115 
118 
124  uint32_t numPoints;
125 
128 
131 
134 
137 
140 
143 
146 
149 
151 
153 typedef struct dwPathDetection
154 {
156  uint32_t numPathsImage;
157 
159  uint32_t numPathsWorld;
160 
163 
166 
169 
171 
175 typedef struct dwPathDetectorObject* dwPathDetectorHandle_t;
176 
191 dwStatus dwPathDetector_initializeFromPathNet(dwPathDetectorHandle_t* obj,
192  dwPathNetHandle_t pathnet,
193  uint32_t frameWidth,
194  uint32_t frameHeight,
195  cudaStream_t stream,
196  dwContextHandle_t ctx);
197 
216  dwPathNetHandle_t pathnet,
217  uint32_t frameWidth,
218  uint32_t frameHeight,
220  dwTransformation3f cam2rig,
221  cudaStream_t stream,
222  dwContextHandle_t ctx);
223 
234 dwStatus dwPathDetector_reset(dwPathDetectorHandle_t obj);
235 
246 dwStatus dwPathDetector_release(dwPathDetectorHandle_t obj);
247 
259 dwStatus dwPathDetector_processDeviceAsync(const dwImageCUDA* frame, dwPathDetectorHandle_t obj);
260 
274 dwStatus dwPathDetector_interpretHost(dwPathDetectorHandle_t obj);
275 
290 dwStatus dwPathDetector_getPathDetections(dwPathDetection* paths, dwPathDetectorHandle_t obj);
291 
304 dwStatus dwPathDetector_setCUDAStream(cudaStream_t stream, dwPathDetectorHandle_t obj);
305 
316 dwStatus dwPathDetector_getCUDAStream(cudaStream_t* stream, dwPathDetectorHandle_t obj);
317 
329  dwPathDetectorHandle_t obj);
330 
343  dwPathDetectorHandle_t obj);
344 
357 dwStatus dwPathDetector_getDetectionROI(dwRect* roi, dwPathDetectorHandle_t obj);
358 
371 dwStatus dwPathDetector_setDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj);
372 
385 dwStatus dwPathDetector_getDetectionThreshold(float32_t* threshold, dwPathDetectorHandle_t obj);
386 
399 dwStatus dwPathDetector_setOppositeTrafficDetectionThreshold(float32_t threshold, dwPathDetectorHandle_t obj);
400 
413 dwStatus dwPathDetector_getOppositeTrafficDetectionThreshold(float32_t* threshold, dwPathDetectorHandle_t obj);
414 
429 dwStatus dwPathDetector_setTemporalSmoothingFactor(float32_t factor, dwPathDetectorHandle_t obj);
430 
444 dwStatus dwPathDetector_getTemporalSmoothingFactor(float32_t* factor, dwPathDetectorHandle_t obj);
445 
458 dwStatus dwPathDetector_getDNNMetaData(dwDNNMetaData* metaData, dwPathDetectorHandle_t obj);
459 
471 dwStatus dwPathDetector_setComputeCenterRailFrom3D(bool computeCenterRailFrom3D, dwPathDetectorHandle_t obj);
472 
484 dwStatus dwPathDetector_getComputeCenterRailFrom3D(bool* computeCenterRailFrom3D, dwPathDetectorHandle_t obj);
485 
498 dwStatus dwPathDetector_setMaxLookAheadDistance(float32_t distance, dwPathDetectorHandle_t obj);
499 
511 dwStatus dwPathDetector_getMaxLookAheadDistance(float32_t* distance, dwPathDetectorHandle_t obj);
512 
513 #ifdef __cplusplus
514 }
515 #endif
516 
517 #endif // DW_PATHDETECTOR_H_
NVIDIA DriveWorks API: Camera Methods
#define DW_PATH_MAX_COUNT
Definition: PathDetector.h:63
float32_t confidence
Confidence value of path.
Definition: PathDetector.h:84
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:74
float32_t confidence
Confidence value of path.
Definition: PathDetector.h:127
NVIDIA DriveWorks API: Core Types
Definition of one path in world coordinate system.
Definition: PathDetector.h:110
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
float32_t confidenceValues[DW_PATH_POINT_MAX_COUNT]
Array containing confidence value per point.
Definition: PathDetector.h:90
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.
Output paths from post-processing.
Definition: PathDetector.h:153
Defines a CUDA image.
Definition: Image.h:266
dwVector2f rightEdgePoints[DW_PATH_POINT_MAX_COUNT]
Array containing path right edge locations.
Definition: PathDetector.h:96
DW_API_PUBLIC dwStatus dwPathDetector_reset(dwPathDetectorHandle_t obj)
Resets the path detector module.
DW_API_PUBLIC dwStatus dwPathDetector_getMaxLookAheadDistance(float32_t *distance, dwPathDetectorHandle_t obj)
Get max look ahead distance.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
uint32_t numPathsImage
Total number of paths.
Definition: PathDetector.h:156
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:99
DW_API_PUBLIC dwStatus dwPathDetector_initializeFromPathNet(dwPathDetectorHandle_t *obj, dwPathNetHandle_t pathnet, uint32_t frameWidth, uint32_t frameHeight, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a path detector module based on PathNet.
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:102
float32_t pathAttributeConfidence
Confidence value of path attributes.
Definition: PathDetector.h:130
dwStatus
Status definition.
Definition: Status.h:166
DW_API_PUBLIC dwStatus dwPathDetector_getDNNMetaData(dwDNNMetaData *metaData, dwPathDetectorHandle_t obj)
Returns the DNN metadata.
DW_API_PUBLIC dwStatus dwPathDetector_initializeFromPathNetWithCameraRig(dwPathDetectorHandle_t *obj, dwPathNetHandle_t pathnet, uint32_t frameWidth, uint32_t frameHeight, dwCameraModelHandle_t cam, dwTransformation3f cam2rig, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a path detector module based on PathNet with camera rig parameters.
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:124
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:67
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.
struct dwPathDetectorObject * dwPathDetectorHandle_t
Handle to path detector.
Definition: PathDetector.h:175
dwPathPositionType positionType
Category of path position.
Definition: PathDetector.h:114
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:159
dwPathPositionType positionType
Category of path position.
Definition: PathDetector.h:71
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:93
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:81
DW_API_PUBLIC dwStatus dwPathDetector_setMaxLookAheadDistance(float32_t distance, dwPathDetectorHandle_t obj)
Set max look ahead distance.
DW_API_PUBLIC dwStatus dwPathDetector_getDetectionThreshold(float32_t *threshold, dwPathDetectorHandle_t obj)
Gets the detection confidence threshold for the PathNet based detector.
#define DW_PATH_POINT_MAX_COUNT
Definition: PathDetector.h:64
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:87
dwPathAttributeType pathAttributeType
Category of path attributes.
Definition: PathDetector.h:117
float32_t pathAngle[DW_PATH_POINT_MAX_COUNT]
Array containing angle in degrees from center rail location.
Definition: PathDetector.h:105
dwTime_t timestamp
Timestamp of frame used for detection.
Definition: PathDetector.h:168