Skip to content
TheMrtN edited this page Jun 17, 2011 · 7 revisions

This page gets you started with OpenTLD and explains some features.

First install the software using the Installation page and solve any problems using the FAQ.

Use your (web)cam for tracking

You can use your own camera for tracking.

  1. In MATLAB, run imaqhwinfo to see what adaptors are installed (for example: 'winvideo' or 'macvideo').
  2. Use a=imaqhwinfo('intalled_adaptor_name'); a.DeviceInfo to figure out the supported formats.
  3. Open initcamera.m and change the line source.vid = videoinput('winvideo', 1,'YUY2_320x240'); with your adaptor name and format.
  4. Open run_TLD.m and set camera to 1 like this: opt.source = struct('camera',0, ...
  5. Run run_TLD.m to start tracking. It will pop up a figure with an image from your camera in which you can draw the bounding box.

Load your own movie

You've seen the motor bike example running, but how do you load your own movie?

  1. Install ffmpeg or another tool that can convert a video into a frame image sequence.
  2. Make a new folder for your own movie (we take /path/to/input/ as an example path).
  3. Convert the movie. For ffmpeg, use: ffmpeg -i movie.avi -sameq /path/to/input/%5d.png. Note: consider using .jpg which might save disk space and time (during tracking).
  4. Tell TLD where your movie is found by opening run_TLD.m and changing input to the folder like this: opt.source = struct('camera',0,'input','/path/to/input/', ...
  5. Run run_TLD.m to start tracking.

It is also possible to load videos without converting them first. See this issue.

Make a movie of the tracking process

Maybe you would like to make a movie of the tracking process to show it to others. You can use screen capture software like Camtasia (Windows), but here's an alternative:

  1. Open other/run_TLD_demo.m and set the save variable to 1 like this: opt.plot = struct('pex',1,'nex',1,'save',1, ...
  2. Start the tracking process by running other/run_TLD_demo.m.
  3. Now each frame is saved to the to the _snapshots/ folder. Use ffmpeg (or another tool) to reconstruct it to a movie: ffmpeg -i _snapshots/%05d.png -sameq movie.mp4

Note that enabling saving will lower your frame rate (fps).

Clone this wiki locally