DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Template Tracker Sample
Note
SW Release Applicability: This sample is available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Description

The Template Tracker sample demonstrates the template tracking capabilities of the Tracking module. It loads a video stream and reads the images sequentially. For each frame, it tracks templates from the previous frame.

Running the Sample

The template tracker sample, sample_template_tracker, accepts the following optional parameters. If none are specified, it will perform detections on a supplied pre-recorded video.

./sample_template_tracker --video=[path/to/file.h264] 
                          --trackMode=[0|1] 
                          --pyramidLevel=[positive number]
                          --pva=[0|1]
                          --pvaEngineNo=[0|1]

where

--video=[path/to/video.h264]
    Is the absolute or relative path of a h264 video.
    Containers such as MP4, AVI, MKV, etc. are not supported.
    Default value: path/to/data/samples/sfm/triangulation/video_0.h264.

--trackMode=[0|1]
    Allows to select the algorithm used for tracking. 
    0: Inverse Additive KLT.
    1: Inverse Compositional KLT.
    Default value: 0

--pyramidLevel=[positive number]
    Defines the number of pyramid levels to build image while tracking.
    Higher level provides better results for large motion, but takes more time.
    This does not have any effect if pva is enabled.
    Default value: 1

--pva=[0|1]
    When set to 1, the template tracker algorithm is performed on PVA hardware.
    Otherwise, it is performed on GPU. 
    Note that PVA can only be used in combination with --trackMode=1.
    Default value: 0

--pvaEngineNo=[0|1]
    If pva is enabled, determines on which PVA the tracker should run on.
    Default value: 0

Output

The sample creates a window, displays the video, and overlays the list of template boxes. It does not detect new templates.

  1. Press space to pause the video.
  2. Use your mouse to draw bounding boxes.
  3. Press space to start the video again.

The video pauses automatically if there are no templates in the video.

sample_template_tracker.png
Tracked template bounding boxes on a single H.264 stream

Additional Information

For more details see Single Camera Template Tracking.