- 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:
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);
For more detailed workflow, please refer to the ligthClassifier sample: Traffic Light Classification Sample (LightNet)