TemporalAnalysis optionally can be used with WaitConditionsDetector to track and stabilize the detected intersection over the frames. Please refer to Wait Conditions Classification Workflow for Traffic Lights and WaitNet Workflow for more details about how to initialize and use the WaitNet DNN and WaitConditionsDetector modules first.
TemporalAnalysis module creates handle of type dwTemporalAnalysisHandle_t
. This handle is owned by the application and must be released by the application when not needed anymore.
An instance of type dwWaitConditionsDetectorTemporalAnalysisParams
encodes parameters that configures the TemporalAnalysis module before initialization. There is no function to initialize this data structure with default values. So all the values must be initialized manually. Here is an example:
taParams
can now be used to initialize the TemporalAnalysis module:
The function dwTemporalAnalysis_initializeSimple()
instantiates the TemporalAnalysis module and assigns the pointer to m_temporalAnalysisHandle
handle. m_ctx
is an initialized instance of dwContextHandle_t
.
cam2Rig
and cam
specify the extrinsic and intrinsic of the camera. cam2Rig
is a pointer to "camera to rig" transformation matrix and cam
is a handle to calibrated camera. m_egoMotion
is a handle to an instance of EgoMotion. These parameters are necessary to map the pixels that are in image-space to real world coordinates and track intersection's position and distance.
After we get the detected intersection from WaitConditionsDetector module (Wait Conditions Classification Workflow for Traffic Lights), we can process it using TemporalAnalysis:
intersection
which is an instance of dwIntersectionDetection
, contains the intersection detected by WaitConditionsDetector module and returned by dwWaitConditionsDetector_getDetectedIntersection()
function (Wait Conditions Classification Workflow for Traffic Lights).
dwTemporalAnalysis_setTargetTimestamp()
sets the current time-stamp and associates it with the detected intersection. camFrameTime
is the time-stamp of current camera frame. dwTemporalAnalysis_addIntersectionEvidence()
adds detected intersection to list of evidences to be processed. requireTransformToGround
is a boolean specifying whether a point in image space should be transformed into a 3-dimensional ground point or not (default is true). dwTemporalAnalysis_runTemporalAnalysis()
uses the current evidence to perform the analysis. dwTemporalAnalysis_getSmoothedIntersection()
can be used to get output of TemporalAnalysis which updates the intersection
object with the tracked and temporally smoothed intersection after the call.
The following function can be used to set the CUDA stream:
The following function can be used to change extrinsic calibration during runtime if necessary:
The following function can be used to release the module: