1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page lightsourceperception_usecase1 LigthSourceDetector Workflow
7 The LightSourceDetector module creates handle of type `dwLightSourceDetectorHandle_t`. This handle is owned by the application and must be released by the application when not needed anymore.
9 An instance of type `dwLightSourceDetectorParams` encodes parameters (currently only perception ROI) and encapsulates a handle to LightSourceNet (of type `dwLightSourceNetHandle_t`) that configures the LightSourceDetector module.
11 To initialize a pointer to a `dwLightSourceDetectorHandle_t` instance with an initialized LightSourceNet handle and default parameter values:
14 dwStatus dwLightSourceDetector_initialize(dwLightSourceDetectorHandle_t* obj,
15 dwLightSourceNetHandle_t ligthSourceNet,
16 dwContextHandle_t ctx);
19 An example code snippet to initialize required modules with default values:
22 dwLightSourceNetHandle_t m_lightSourceNet = DW_NULL_HANDLE;
23 dwLightSourceNetParams m_lightSourceNetParams{};
24 dwLightSourceDetectorHandle_t m_lightSourceDetector = DW_NULL_HANDLE;
26 // Initialize LightSourceNet
27 CHECK_DW_ERROR(dwLightSourceNet_initDefaultParams(&m_lightSourceNetParams));
28 CHECK_DW_ERROR(dwLightSourceNet_initialize(&m_lightSourceNet, &m_lightSourceNetParams, m_sdk));
30 // dwLightSourceDetector_initialize
31 CHECK_DW_ERROR(dwLightSourceDetector_initialize(&m_lightSourceDetector, m_lightSourceNet, m_sdk));
34 where `m_sdk` is an initialized instance of `dwContextHandle_t`.
38 With initialized handle to the LightSourceDetector module, the following functions can be used to perform inference on an image and retrieve the processed output, which indicate binary ON/OFF high beam signal:
43 /// High beam ON/OFF binary flag.
46 } dwLightSourceDetectorAutoBeamStatus;
49 dwStatus dwLightSourceDetector_bindInput(const dwImageCUDA* imageRGB,
50 const dwImageCUDA* imageBayer,
51 dwLightSourceDetectorHandle_t obj);
54 dwStatus dwLightSourceDetector_bindOutputAutoBeamStatus(dwLightSourceDetectorAutoBeamStatus* output,
55 dwLightSourceDetectorHandle_t obj);
58 dwStatus dwLightSourceDetector_bindOutputDetectorMask(dwLightSourceDetectorMask* output,
59 dwLightSourceDetectorHandle_t obj);
62 /// Input image is preprocessed on GPU side with certain predefined transformations
63 /// in order to have the right properties required by DNN inference.
64 DW_LSP_DETECTOR_STAGE_GPU_PREPROCESS = 0,
66 /// DNN inference is run on prepared image.
67 DW_LSP_DETECTOR_STAGE_GPU_INFERENCE = 1,
69 /// DNN inference is run on prepared image.
70 DW_LSP_DETECTOR_STAGE_GPU_POSTPROCESS = 2,
72 /// After inference CPU runs post processing.
73 DW_LSP_DETECTOR_STAGE_CPU_POSTPROCESS = 3,
75 } dwLightSourceDetectorStage;
78 dwStatus dwLightSourceDetector_process(dwLightSourceDetectorStage stage,
79 dwLightSourceDetectorHandle_t obj);
85 The following functions can be used to reset or release the initialized module handles whenever necessary:
88 dwStatus dwLightSourceDetector_release(dwLightSourceDetectorHandle_t obj);
91 For usage of a sample application, please refer to @ref dwx_lightsourceperception_sample.
93 ## Additional Information
95 See @ref lightsourcenet_mainsection for information on DNN used in this perception module (LightSourceNet).