DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

perception/landmarks/camera/docs/usecase_segmentation.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page landmarks_usecase_segmentation Landmark Detector Segmentation Init Workflow
4 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
5 
6 The following code snippet demonstrates the general structure of a program utilizing @ref landmarks_mainsection to detect landmarks from a single camera. Error handling is left out for clarity.
7 @note Afer the initialization phase this workflow is identical to @ref landmarks_usecase_regressor.
8 
9 ### Initializing MapNet's Default Parameters and MapNet Module using Segmentation Network
10 
11 ```{.cpp}
12 dwMapNetParams mapNetParams{};
13 dwMapNet_initDefaultParams(&mapNetParams, DW_MAPNET_TYPE_SEGMENTATION, sdkHandle);
14 dwMapNet_initialize(&mapNetHandle, &mapNetParams, sdkHandle);
15 
16 ```
17 
18 ### Initializing the Landmark Detection Module from the Initialized MapNet Handle
19 
20 ```{.cpp}
21 // Initialize LandmarkDetector from MapNet
22 uint32_t frameWidth;
23 uint32_t frameHeight;
24 
25 // initialize parameters
26 dwLandmarkDetectorParams params;
27 dwLandmarkDetector_initializeDefaultParams(&params, frameWidth, frameHeight));
28 params.landmarkDetectionThreshold[DW_LANDMARK_TYPE_LANES] = 0.3;
29 params.landmarkTypesEnabled = DW_LANDMARK_SELECTION_MASK_LANE_MARKING | DW_LANDMARK_SELECTION_MASK_POLES;
30 params.isModelParameterFitting[DW_LANDMARK_TYPE_LANES] = true;
31 params.detectionROI = {0, 0, 960, 480};
32 
33 dwLandmarkDetector_initializeFromMapNet(&landmarkDetectorHandle, mapNetHandle, params, frameWidth, frameHeight, sdkHandle);
34 ```
35 
36 ### Detecting Landmark Markings from a Video Sequence
37 
38 ```{.cpp}
39 dwLaneDetection lanes{};
40 dwLandmarkDetection landmarks{};
41 while (true)
42 {
43  dwLandmarkDetector_detectLandmarks(&lanes, &landmarks, frame, landmarkDetectorHandle);
44 }
45 
46 ```
47 
48 ### Releasing the Module Handles when Finished
49 
50 ```{.cpp}
51 dwLandmarkDetector_release(landmarkDetectorHandle);
52 dwMapNet_release(mapNetHandle);
53 ```
54 
55 For a more detailed workflow, please refer to the following samples:
56 - @ref dwx_landmark_perception_sample.