DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Wait Conditions Classification Workflow for Traffic Lights
Note
SW Release Applicability: This tutorial is applicable to modules in NVIDIA DRIVE Software releases.

The following code snippet shows the general structure of a program that uses waitconditions classifier to classify detected traffic lights from a single camera. Note that error handling is left out for clarity.

Initialize LightNet default parameters and then the module:

dwLightNetParams lightNetParams{};
dwLightNet_initialize(&lightNetHandle,&lightNetParams, sdkHandle);

Initialize Waitcondition classifier module from initialized LightNet handle:

dwTrafficLightSignClassifier_initializeFromLightNet(&lightClassifierHandle,
lightNetHandle,
sdkHandle);

Classify detected traffic lights 'trafficLightList' from a frame:

dwTrafficLightSignClassifier_inferDeviceAsync(frame, &trafficLightList, numTrafficLights, dwObjectClassTrafficLight, &objectClassifierHandle);
dwTrafficLightSignClassifier_interpretHost(numTrafficLights, dwObjectClassTrafficLight, &objectClassifierHandle);
dwTrafficLightSignClassifier_getClassifiedObjects(&trafficLightList, numTrafficLights, &objectClassifierHandle);

When finished, release the module handles:

dwTrafficLightSignClassifier_release(objectClassifierHandle);
dwLightNet_release(lightNetHandle);

For more detailed workflow, please refer to the ligthClassifier sample: Traffic Light Classification Sample (LightNet)