1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page pathperception_usecase1_pathdetector Path Perception Workflow
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
7 The following code snippet shows the general structure of a program that uses path detector to detect drive-able paths from a single camera. Note that error handling is left out for clarity.
9 Initialize PathNet default parameters and then the module:
11 dwPathNetParams pathNetParams{};
12 dwPathNet_initDefaultParams(&pathNetParams));
13 dwPathNet_initialize(&pathNetHandle, &pathNetParams, sdkHandle));
16 Initialize Path detector module from initialized PathNet handle without calibrated camera:
18 dwPathDetector_initializeFromPathNet(&pathDetectorHandle,
26 Initialize Path detector module from initialized PathNet handle with calibrated camera:
28 dwPathDetector_initializeFromPathNet(&pathDetectorHandle,
32 calibratedCameraHandle,
38 Initialize detector parameters (optional):
40 dwPathDetector_setTemporalSmoothFactor(temporalSmoothFactor, pathDetectorHandle);
42 dwPathDetector_setDetectionROI(&roi, pathDetectorHandle);
43 dwStatus dwPathDetector_setComputeCenterRailFrom3D(computeCenterRailFrom3D, pathDetectorHandle);
46 Detect paths from a video sequence:
50 dwPathDetection paths{};
51 dwPathDetector_processDeviceAsync(frame, pathDetectorHandle);
52 dwPathDetector_interpretHost(pathDetectorHandle);
53 dwPathDetector_getPathDetections(&paths, pathDetectorHandle);
57 When finished, release the module handles:
59 dwPathDetector_release(pathDetectorHandle);
60 dwPathNet_release(pathNetHandle);
63 For more detailed workflow, please refer to the path detection sample: @ref dwx_path_perception_sample