DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Landmark Detector Segmentation Init Workflow
Note
SW Release Applicability: This tutorial is applicable to modules in NVIDIA DRIVE Software releases.

The following code snippet demonstrates the general structure of a program utilizing Landmark Perception to detect landmarks from a single camera. Error handling is left out for clarity.

Note
Afer the initialization phase this workflow is identical to Landmark Detector Regressor Init Workflow.

Initializing MapNet's Default Parameters and MapNet Module using Segmentation Network

dwMapNetParams mapNetParams{};
dwMapNet_initialize(&mapNetHandle, &mapNetParams, sdkHandle);

Initializing the Landmark Detection Module from the Initialized MapNet Handle

// Initialize LandmarkDetector from MapNet
uint32_t frameWidth;
uint32_t frameHeight;
// initialize parameters
dwLandmarkDetector_initializeDefaultParams(&params, frameWidth, frameHeight));
params.landmarkDetectionThreshold[DW_LANDMARK_TYPE_LANES] = 0.3;
params.isModelParameterFitting[DW_LANDMARK_TYPE_LANES] = true;
params.detectionROI = {0, 0, 960, 480};
dwLandmarkDetector_initializeFromMapNet(&landmarkDetectorHandle, mapNetHandle, params, frameWidth, frameHeight, sdkHandle);

Detecting Landmark Markings from a Video Sequence

dwLandmarkDetection landmarks{};
while (true)
{
dwLandmarkDetector_detectLandmarks(&lanes, &landmarks, frame, landmarkDetectorHandle);
}

Releasing the Module Handles when Finished

dwLandmarkDetector_release(landmarkDetectorHandle);
dwMapNet_release(mapNetHandle);

For a more detailed workflow, please refer to the following samples: