DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

waitcondition/camera/docs/usecase1.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page waitcondition_usecase1 Wait Conditions Classification Workflow for Traffic Lights
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
6 
7 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.
8 
9 Initialize LightNet default parameters and then the module:
10 ```{.cpp}
11 dwLightNetParams lightNetParams{};
12 dwLightNet_initDefaultParams(&lightNetParams);
13 dwLightNet_initialize(&lightNetHandle,&lightNetParams, sdkHandle);
14 ```
15 
16 Initialize Waitcondition classifier module from initialized LightNet handle:
17 ```{.cpp}
18 dwTrafficLightSignClassifier_initializeFromLightNet(&lightClassifierHandle,
19  lightNetHandle,
20  sdkHandle);
21 ```
22 
23 Classify detected traffic lights 'trafficLightList' from a frame:
24 ```{.cpp}
25 dwTrafficLightSignClassifier_inferDeviceAsync(frame, &trafficLightList, numTrafficLights, dwObjectClassTrafficLight, &objectClassifierHandle);
26 dwTrafficLightSignClassifier_interpretHost(numTrafficLights, dwObjectClassTrafficLight, &objectClassifierHandle);
27 dwTrafficLightSignClassifier_getClassifiedObjects(&trafficLightList, numTrafficLights, &objectClassifierHandle);
28 
29 ```
30 
31 When finished, release the module handles:
32 ```{.cpp}
33 dwTrafficLightSignClassifier_release(objectClassifierHandle);
34 dwLightNet_release(lightNetHandle);
35 ```
36 
37 For more detailed workflow, please refer to the ligthClassifier sample: @ref dwx_light_classification_sample