DriveWorks SDK Reference

| 0.6.67 Release

LaneDetector.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-2016 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 
45 #ifndef DW_LANEDETECTOR_H__
46 #define DW_LANEDETECTOR_H__
47 
48 #include <dw/core/Context.h>
49 #include <dw/core/Types.h>
50 #include <dw/image/Image.h>
51 #include <dw/dnn/DNN.h>
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #define DW_LANEMARK_MAX_COUNT 16
59 #define DW_LANEMARK_POINT_MAX_COUNT 128
60 
61 
62 #pragma pack(push,1) // Make sure we have consistent structure packings
63 
65 typedef enum
66 {
69 
71 typedef enum
72 {
77 
80 
82 typedef struct {
83 
86 
89 
91  uint32_t numPoints;
92 
95 
97 
99 typedef struct dwLaneDetection {
100 
102  uint32_t numLaneMarkings;
103 
106 
108 
112 typedef struct dwLaneDetectorObject *dwLaneDetectorHandle_t;
113 
126 dwStatus dwLaneDetector_initializeLaneNet(dwLaneDetectorHandle_t *obj,
127  uint32_t frameWidth,
128  uint32_t frameHeight,
129  dwContextHandle_t ctx);
130 
141 dwStatus dwLaneDetector_reset(dwLaneDetectorHandle_t obj);
142 
155 dwStatus dwLaneDetector_release(dwLaneDetectorHandle_t *obj);
156 
169 dwStatus dwLaneDetector_processDeviceAsync(const dwImageCUDA* frame, dwLaneDetectorHandle_t obj);
170 
184 dwStatus dwLaneDetector_interpretHost(dwLaneDetectorHandle_t obj);
185 
186 
199 dwStatus dwLaneDetector_setCUDAStream(cudaStream_t stream, dwLaneDetectorHandle_t obj);
200 
211 dwStatus dwLaneDetector_getCUDAStream(cudaStream_t *stream, dwLaneDetectorHandle_t obj);
212 
225  dwLaneDetectorHandle_t obj);
226 
238 dwStatus dwLaneDetector_getDetectionROI(dwRect* roi, dwLaneDetectorHandle_t obj);
239 
255 dwStatus dwLaneDetector_getLaneDetections(dwLaneDetection *lanes, dwLaneDetectorHandle_t obj);
256 
269 
281 dwStatus dwLaneDetector_setCameraExtrinsics(dwTransformation cam2rig, dwLaneDetectorHandle_t obj);
282 
294 dwStatus dwLaneDetector_setMaxLaneDistance(float32_t maxDistance, dwLaneDetectorHandle_t obj);
295 
296 
297 // ------------ LaneNet specific methods -------------------------------
309 dwStatus dwLaneDetectorLaneNet_setDetectionThreshold(float32_t threshold, dwLaneDetectorHandle_t obj);
310 
324 dwStatus dwLaneDetectorLaneNet_setTemporalSmoothFactor(float32_t factor, dwLaneDetectorHandle_t obj);
325 
338 dwStatus dwLaneDetectorLaneNet_getTemporalSmoothFactor(float32_t* factor, dwLaneDetectorHandle_t obj);
339 
351 dwStatus dwLaneDetectorLaneNet_setHorizontalFOV(float32_t hfov, dwLaneDetectorHandle_t obj);
352 
362 dwStatus dwLaneDetectorLaneNet_getDNNMetaData(dwDNNMetaData* metaData, dwLaneDetectorHandle_t obj);
363 
364 #pragma pack(pop)
365 
366 #ifdef __cplusplus
367 }
368 #endif
369 
370 #endif // DW_LANEDETECTOR_H__
lane marking on the right side next to ego lane
Definition: LaneDetector.h:76
lane marking has been identifed but has not been categorized
Definition: LaneDetector.h:78
DW_API_PUBLIC dwStatus dwLaneDetector_getCUDAStream(cudaStream_t *stream, dwLaneDetectorHandle_t obj)
Gets CUDA stream used by the lane detection.
NVIDIA DriveWorks API: Camera Methods
NVIDIA DriveWorks API: Core Types
all detected lane markings are treated the same type
Definition: LaneDetector.h:67
DW_API_PUBLIC dwStatus dwLaneDetector_initializeLaneNet(dwLaneDetectorHandle_t *obj, uint32_t frameWidth, uint32_t frameHeight, dwContextHandle_t ctx)
Initializes a lane detector module based on LaneNet.
float float32_t
Specifies POD types.
Definition: Types.h:77
Defines a rectangle.
Definition: Types.h:151
Defines a two-element floating-point vector.
Definition: Types.h:207
DW_API_PUBLIC dwStatus dwLaneDetector_setCameraExtrinsics(dwTransformation cam2rig, dwLaneDetectorHandle_t obj)
Set the transformation from camera to rig.
right lane marking of the ego lane
Definition: LaneDetector.h:75
DW_API_PUBLIC dwStatus dwLaneDetector_setDetectionROI(const dwRect *roi, dwLaneDetectorHandle_t obj)
Set detection Region of Interest (ROI) for the detector.
Defines a CUDA image.
Definition: Image.h:263
DW_API_PUBLIC dwStatus dwLaneDetectorLaneNet_getTemporalSmoothFactor(float32_t *factor, dwLaneDetectorHandle_t obj)
Gets the temporal smoothing factor for the LaneNet based detector.
NVIDIA DriveWorks API: Core Methods
DW_API_PUBLIC dwStatus dwLaneDetector_getLaneDetections(dwLaneDetection *lanes, dwLaneDetectorHandle_t obj)
Gets the latest computed results in image coordinates.
#define DW_LANEMARK_POINT_MAX_COUNT
Definition: LaneDetector.h:59
DW_API_PUBLIC dwStatus dwLaneDetectorLaneNet_setDetectionThreshold(float32_t threshold, dwLaneDetectorHandle_t obj)
Sets the detection confidence threshold for the LaneNet based detector.
dwLaneMarkType lineType
Category of the line type of lane marking.
Definition: LaneDetector.h:88
#define DW_LANEMARK_MAX_COUNT
Definition: LaneDetector.h:58
DW_API_PUBLIC dwStatus dwLaneDetector_reset(dwLaneDetectorHandle_t obj)
Resets the lane detector module.
NVIDIA DriveWorks API: DNN Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
dwStatus
Status definition.
Definition: Status.h:167
struct dwCalibratedCameraObject * dwCalibratedCameraHandle_t
A pointer to the handle representing a calibrated camera.
Definition: Camera.h:66
The output format of detected lanes.
Definition: LaneDetector.h:99
dwLanePositionType
Defintion of the position of a lane marking in respect to the ego lane.
Definition: LaneDetector.h:71
uint32_t numLaneMarkings
Number of detected lane markings.
Definition: LaneDetector.h:102
uint32_t numPoints
Number of points in the array.
Definition: LaneDetector.h:91
dwLanePositionType positionType
Category of the position of lane marking.
Definition: LaneDetector.h:85
DW_API_PUBLIC dwStatus dwLaneDetector_setCUDAStream(cudaStream_t stream, dwLaneDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
DW_API_PUBLIC dwStatus dwLaneDetector_setCameraHandle(dwCalibratedCameraHandle_t cam, dwLaneDetectorHandle_t obj)
Set the handle to the calibrated front looking camera.
A defintion of one lane.
Definition: LaneDetector.h:82
DW_API_PUBLIC dwStatus dwLaneDetector_getDetectionROI(dwRect *roi, dwLaneDetectorHandle_t obj)
Get detection Region of Interest (ROI) for the detector.
DW_API_PUBLIC dwStatus dwLaneDetector_release(dwLaneDetectorHandle_t *obj)
Releases the detector module.
struct dwLaneDetectorObject * dwLaneDetectorHandle_t
Handle to a DataConditioner.
Definition: LaneDetector.h:112
DW_API_PUBLIC dwStatus dwLaneDetector_interpretHost(dwLaneDetectorHandle_t obj)
Runs the interpretation of the processed results on the CPU.
left lane marking of the ego lane
Definition: LaneDetector.h:74
DW_API_PUBLIC dwStatus dwLaneDetector_setMaxLaneDistance(float32_t maxDistance, dwLaneDetectorHandle_t obj)
Set the maximum distance in meters at which lane markings can be detected.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
Specifies TensorRT model header.
Definition: DNN.h:68
dwLaneMarkType
Type of a lane mark.
Definition: LaneDetector.h:65
dwLaneMarking laneMarkings[DW_LANEMARK_MAX_COUNT]
Detected lane markings.
Definition: LaneDetector.h:105
DW_API_PUBLIC dwStatus dwLaneDetectorLaneNet_setTemporalSmoothFactor(float32_t factor, dwLaneDetectorHandle_t obj)
Sets the temporal smoothing factor for the LaneNet-based detector.
DW_API_PUBLIC dwStatus dwLaneDetectorLaneNet_getDNNMetaData(dwDNNMetaData *metaData, dwLaneDetectorHandle_t obj)
Returns the DNN metadata.
DW_API_PUBLIC dwStatus dwLaneDetectorLaneNet_setHorizontalFOV(float32_t hfov, dwLaneDetectorHandle_t obj)
Sets the input camera horizontal Field Of View (FOV) in degree for the LaneNet-based detector...
DW_API_PUBLIC dwStatus dwLaneDetector_processDeviceAsync(const dwImageCUDA *frame, dwLaneDetectorHandle_t obj)
Processes the given frame on the GPU asynchronously.
lane marking on the left side next to ego lane
Definition: LaneDetector.h:73
#define DW_API_PUBLIC
Definition: Exports.h:76