Defines path detector module based on PathNet, i.e., DNN based path detector.
Defines path detector process pipeline module based on PathNet, i.e., DNN based path detector.
Data Structures | |
| struct | dwPathDetection |
| Output paths from post-processing. More... | |
| struct | dwPathDetectorFoveaParams |
| struct | dwPathNetPath |
| Definition of one path in image coordinate system. More... | |
| struct | dwPathNetPath3D |
| Definition of one path in world coordinate system. More... | |
Macros | |
| #define | DW_PATH_MAX_COUNT 8 |
| #define | DW_PATH_POINT_MAX_COUNT 128 |
Typedefs | |
| typedef struct dwPathDetectorObject * | dwPathDetectorHandle_t |
| Handle to path detector. More... | |
Enumerations | |
| enum | dwPathDetectorStage { DW_PATHDETECTOR_STAGE_GPU_ASYNC_PREPROCESSING = 0, DW_PATHDETECTOR_STAGE_GPU_ASYNC_INFERENCE = 1, DW_PATHDETECTOR_STAGE_CPU_POSTPROCESSING = 2, DW_PATHDETECTOR_STAGE_COUNT = 3 } |
| Defines the processing stages of a path detector. More... | |
| struct dwPathDetection |
| Data Fields | ||
|---|---|---|
| uint32_t | numPathsImage | Total number of paths. |
| uint32_t | numPathsWorld | Total number of valid paths in world coordinates. |
| dwPathNetPath | pathsImage[DW_PATH_MAX_COUNT] | Post processed paths in image coordinates. |
| dwPathNetPath3D | pathsWorld[DW_PATH_MAX_COUNT] | Post processed paths in world coordinates. |
| dwTime_t | timestamp | Timestamp of frame used for detection. |
| struct dwPathDetectorFoveaParams |
| Data Fields | ||
|---|---|---|
| bool | enableFovea | |
| dwRect | ROI | |
| struct dwPathNetPath |
| Data Fields | ||
|---|---|---|
| dwVector2f | centerRailPoints[DW_PATH_POINT_MAX_COUNT] | Array containing path center locations. |
| float32_t | confidence | Confidence value of path. |
| float32_t | confidenceValues[DW_PATH_POINT_MAX_COUNT] | Array containing confidence value per point. |
| dwVector2f | leftEdgePoints[DW_PATH_POINT_MAX_COUNT] | Array containing path left edge locations. |
| uint32_t | numPoints |
The total number of points that defines either right edge or left edge or center rail of each drive-able path. In any case, total number of points for the right, left and the center edge are equal. |
| float32_t | pathAngle[DW_PATH_POINT_MAX_COUNT] | Array containing angle in degrees from center rail location. |
| float32_t | pathAttributeConfidence | Confidence value of path attributes. |
| dwPathAttributeType | pathAttributeType | Category of path attributes. |
| float32_t | pathWidth[DW_PATH_POINT_MAX_COUNT] | Array containing width of center rail location. |
| dwPathPositionType | positionType | Category of path position. |
| dwVector2f | rightEdgePoints[DW_PATH_POINT_MAX_COUNT] | Array containing path right edge locations. |
| struct dwPathNetPath3D |
| Data Fields | ||
|---|---|---|
| dwVector3f | centerRailPoints[DW_PATH_POINT_MAX_COUNT] | Array containing path center locations. |
| float32_t | confidence | Confidence value of path. |
| float32_t | confidenceValues[DW_PATH_POINT_MAX_COUNT] | Array containing confidence value per point. |
| dwVector3f | leftEdgePoints[DW_PATH_POINT_MAX_COUNT] | Array containing path left edge locations. |
| uint32_t | numPoints |
The total number of points that defines either right edge or left edge or center rail of each drive-able path. In any case, total number of points for the right, left and the center edge are equal. |
| float32_t | pathAngle[DW_PATH_POINT_MAX_COUNT] | Array containing angle in degrees from center rail location. |
| float32_t | pathAttributeConfidence | Confidence value of path attributes. |
| dwPathAttributeType | pathAttributeType | Category of path attributes. |
| float32_t | pathWidth[DW_PATH_POINT_MAX_COUNT] | Array containing width of center rail location. |
| dwPathPositionType | positionType | Category of path position. |
| dwVector3f | rightEdgePoints[DW_PATH_POINT_MAX_COUNT] | Array containing path right edge locations. |
| #define DW_PATH_MAX_COUNT 8 |
Definition at line 64 of file PathDetector.h.
| #define DW_PATH_POINT_MAX_COUNT 128 |
Definition at line 65 of file PathDetector.h.
| typedef struct dwPathDetectorObject* dwPathDetectorHandle_t |
Handle to path detector.
Definition at line 182 of file PathDetector.h.
| enum dwPathDetectorStage |
Defines the processing stages of a path detector.
| Enumerator | |
|---|---|
| DW_PATHDETECTOR_STAGE_GPU_ASYNC_PREPROCESSING | |
| DW_PATHDETECTOR_STAGE_GPU_ASYNC_INFERENCE | |
| DW_PATHDETECTOR_STAGE_CPU_POSTPROCESSING | |
| DW_PATHDETECTOR_STAGE_COUNT | |
Definition at line 62 of file PathDetector_processPipeline.h.
| DW_API_PUBLIC dwStatus dwPathDetector_bindInputTensor | ( | dwAutoNetOutputHandle_t | netTensor, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Binds the network inference output tensor.
| [in] | netTensor | network detection tensor |
| [in] | obj | Specifies the PathDetector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_bindPathsOutput | ( | dwPathDetection * | output, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Binds the paths output of the detector to a structure.
| [out] | output | A user pointer to be filled with information about detected paths. |
| [in] | obj | A path detector handle. |
| 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 on the CPU, and gets the latest computed results.
| [out] | paths | A user pointer to be filled with information about detected paths. |
| [in] | frame | CUDA frame to be processed for detection. |
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_detectPathsAutoNet | ( | dwPathDetection * | paths, |
| dwAutoNetOutputHandle_t | input, | ||
| dwPathDetectorHandle_t | obj | ||
| ) |
Detects paths from the given DNN inference output.
The array for the output detections has to be allocated beforehand.
| [out] | paths | A user pointer to be filled with information about detected paths |
| [in] | input | DNN inference output. |
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_getComputeCenterRailFrom3D | ( | bool * | computeCenterRailFrom3D, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Get the flag to compute 3D center rail from 3D path edges.
| [out] | computeCenterRailFrom3D | flag to compute 3D center rail from 3D path edges. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_getCUDAStream | ( | cudaStream_t * | stream, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Gets CUDA stream used by the path detection.
| [out] | stream | The CUDA stream currently used. |
| [in] | obj | A handle to the path detection module. |
| DW_API_PUBLIC dwStatus dwPathDetector_getDetectionROI | ( | dwRect * | roi, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Get detection Region of Interest (ROI) for the detector.
| [out] | roi | ROI of frame to be processed by the detector, default to full frame |
| [in] | obj | A path detector handle |
| DW_API_PUBLIC dwStatus dwPathDetector_getDetectionThreshold | ( | float32_t * | threshold, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Gets the detection confidence threshold for the PathNet based detector.
| [out] | threshold | Confidence threshold above which the DNN result is considered valid path information. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_getDNNMetaData | ( | dwDNNMetaData * | metaData, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Returns the DNN metadata.
| [out] | metaData | Pointer to metaData struct. |
| [in] | obj | Specifies the PathNet handle. |
| 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.
| [out] | threshold | above which the DNN result is considered opposite traffic direction. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_getPathDetections | ( | dwPathDetection * | paths, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Gets the latest computed results in image coordinates.
This method has to be executed after dwpathDetector_interpretHost() to get the current output of the detector.
| [out] | paths | A user pointer to be filled with information about detected paths. |
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_getTemporalSmoothingFactor | ( | float32_t * | factor, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Gets the temporal smoothing factor from Path detector.
| [out] | factor | Average previous and current path detection points, which is calculated as: smoothed point = factor*previous point + (1.0-factor)*current point |
| [in] | obj | A path detector handle |
| DW_API_PUBLIC dwStatus dwPathDetector_getUseFovea | ( | bool * | useFovea, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Get fovea processing mode.
| [out] | useFovea | Process fovea frame. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| 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.
| [out] | obj | A pointer to the path detector handle for the created module. |
| [in] | autonet | Specifies the handle to the autonet module. |
| [in] | frameWidth | Width of camera frames to apply path detector later. |
| [in] | frameHeight | Height of camera frames to apply path detector later. |
| [in] | stream | CUDA stream on which to perform all operations. |
| [in] | ctx | Specifies the handler to the context to create PathNet. |
| 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.
| [out] | obj | A pointer to the PathDetector handle for the created module. |
| [in] | pathnet | Specifies the handle to the PathNet module. |
| [in] | frameWidth | Width of camera frames to apply path detector later. |
| [in] | frameHeight | Height of camera frames to apply path detector later. |
| [in] | foveaParams | Fovea processing enable and ROI parameters. |
| [in] | stream | CUDA stream on which to perform all operations. |
| [in] | ctx | Specifies the handle to the context to create PathNet. |
| 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.
| [out] | obj | A pointer to the PathDetector handle for the created module. |
| [in] | pathnet | Specifies the handle to the PathNet module. |
| [in] | frameWidth | Width of camera frames to apply path detector later. |
| [in] | frameHeight | Height of camera frames to apply path detector later. |
| [in] | foveaParams | Fovea processing enable and ROI parameters. |
| [in] | cam | Specifies the handle to the calibrated camera. |
| [in] | cam2rig | Specifies the transformation from camera to rig. |
| [in] | stream | CUDA stream on which to perform all operations. |
| [in] | ctx | Specifies the handle to the context to create PathNet. |
| DW_API_PUBLIC dwStatus dwPathDetector_interpretHost | ( | dwPathDetectorHandle_t | obj | ) |
Runs the interpretation of the processed results on the CPU.
To get the actual output of the detector, this method must be executed after dwPathDetector_processDeviceAsync().
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_process | ( | dwPathDetectorStage | stage, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Process the bound input frame and store the result to where pointed by bound output.
| [in] | stage | the processing stage to be executed. |
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_processDeviceAsync | ( | const dwImageCUDA * | frame, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Processes the given frame on the GPU asynchronously.
| [in] | frame | CUDA frame to be processed for detection. |
| [in] | obj | A path detector handle. |
| DW_API_PUBLIC dwStatus dwPathDetector_release | ( | dwPathDetectorHandle_t | obj | ) |
Releases the detector module.
| [in] | obj | The object handle to release. |
| DW_API_PUBLIC dwStatus dwPathDetector_reset | ( | dwPathDetectorHandle_t | obj | ) |
Resets the path detector module.
| [in] | obj | Specifies the detector to reset. |
| DW_API_PUBLIC dwStatus dwPathDetector_setCameraExtrinsics | ( | const dwTransformation3f * | cam2Rig, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Sets new calibrated camera extrinsic.
| [in] | cam2Rig | specifies camera to rig transformation |
| [in] | obj | A path detector handle |
| DW_API_PUBLIC dwStatus dwPathDetector_setComputeCenterRailFrom3D | ( | bool | computeCenterRailFrom3D, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Set the flag to compute 3D center rail from 3D path edges.
| [in] | computeCenterRailFrom3D | flag to compute 3D center rail from 3D path edges. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_setCUDAStream | ( | cudaStream_t | stream, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Sets the CUDA stream for CUDA related operations.
| [in] | stream | The CUDA stream to be used. Default is the one passed during initialization. |
| [in] | obj | A handle to the path detector module for which to set CUDA stream. |
| DW_API_PUBLIC dwStatus dwPathDetector_setDetectionROI | ( | const dwRect * | roi, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Set detection Region of Interest (ROI) for the detector.
| [in] | roi | ROI of frame to be processed by the detector, default to full frame |
| [in] | obj | A path detector handle |
| DW_API_PUBLIC dwStatus dwPathDetector_setDetectionThreshold | ( | float32_t | threshold, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Sets the detection confidence threshold for the PathNet based detector.
| [in] | threshold | Confidence threshold above which the DNN result is considered valid path information. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_setOppositeTrafficDetectionThreshold | ( | float32_t | threshold, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Sets the opposite traffic detection confidence threshold for the PathNet based detector.
| [in] | threshold | above which the DNN result is considered opposite traffic direction. |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_setTemporalSmoothingFactor | ( | float32_t | factor, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Sets the temporal smoothing factor for the Path detector.
| [in] | factor | Average previous and current path detection points, which is calculated as: smoothed point = factor*previous point + (1.0-factor)*current point |
| [in] | obj | A path detector handle (must be of type PathNet). |
| DW_API_PUBLIC dwStatus dwPathDetector_setUseFovea | ( | bool | useFovea, |
| dwPathDetectorHandle_t | obj | ||
| ) |
Set fovea processing mode.
| [in] | useFovea | Process fovea frame. |
| [in] | obj | A path detector handle (must be of type PathNet). |