The tutorial shows the general structure of a program that uses the 2D template tracker to track templates in a single camera.
contextHandle
is assumed to be previously initialized dwContextHandle_t
.
imageProps
is the dwImageProperties
structure of image to be tracked
Select on which processor the tracker should be performed on. Possible options are DW_PROCESSOR_TYPE_GPU
, DW_PROCESSOR_TYPE_PVA_0
, DW_PROCESSOR_TYPE_PVA_1
. Note that PVA is only supported on NVIDIA DRIVE™ platforms. Moreover, if the processor is set to PVA, the image dimensions need to be provided at initialization.
Create 2 image pyramids as detection/tracking input: one is current, one is previous, the 2 pyramids work as a double buffer (or ping-pong buffer). They swap each other after each detection/tracking cycle. So new frame will always be read into pyramidCurrent and the previous frame will be stored to pyramidPrevious.
dwPyramid_create
only creates pyramid image and allocates memory, pyramid will be filled in dwImageFilter_computePyramid
. Top level (level 0) in pyramid is always the same size as original input image.
inputImageProps.width
, inputImageProps.height
are the same in tracker/detector initialization
imagePxlType
should be got from dwImage_getPixelType(inputImageProps.format)
.
contextHandle
is assumed to be previously initialized dwContextHandle_t.
For the full implementation, refer to Template Tracker Sample.