Keyframe Tracking
Calculating tracks using keyframes can be the better option for more complex patterns and movement. It requires a little more work to set up, but can produce more reliable tracks.
Unlike auto-tracks, keyframe tracking compares the current pattern anchor to the patterns of the two nearest keyframes.
To help avoid clutter in the Viewer, you can enable or disable the Tracker overlay by right-clicking in the Viewer and selecting Overlay, or by pressing Q to toggle between the available states:
• overlay off
• overlay on
• overlay on, no animation path
Calculating Keyframe Tracks
To calculate keyframe tracks:
1. | In the Tracker properties panel, select each track you wish to calculate in the Tracks list or click select all. |
2. | For each track, select the type of movement the track is intended to output: translation, rotation, or scaling. For example, tracking a feature across the sequence and toward the camera may involve translation and scale. |
3. | Scrub through the sequence a few frames and adjust the position of the tracking anchor by dragging the anchor to the location of the pattern. You can use the zoom window to fine-tune your positioning. Continue on through the sequence as required. |
Tip: You can change the magnification of zoom windows by holding Shift and dragging the magnifying glass cursor away from the center of the window.
At each frame, a new keyframe window is added to the right of the zoom window. The keyframe closest to the current playhead frame is highlighted in orange.
It’s a good idea to place more keyframes around areas of complexity or greater movement and fewer on straight forward translation. Generally speaking, a greater number of keyframes produces a better track, but at the expense of processing time.
4. | When you’re satisfied with your keyframes, make sure all your tracks are selected in the Tracks list and then click to track all keyframes. |
Tip: When calculating multiple tracks simultaneously, you may find that some tracks stick accurately to the pattern, while others require resetting and reanalysis. When you’re happy with a given track, deselect it in the Tracks list. This protects it from recalculation, and lets you experiment with better placement for the wayward tracks.
5. | You can also force the selected tracks to recalculate between the two nearest keyframes by clicking in the Viewer toolbar. |
See Troubleshooting Keyframe Tracks for help with troublesome tracks.
Importing Tracking Data
You can import tracking data from third-party software using a plain text file containing three values in each line, frame, x, and y coordinates. Tracker can read files with values separated by spaces, commas, or colons and any blank lines or lines starting with #, ;, and / are ignored. For example, importing a file containing:
# Tracking Data
1,1,1
10,240,240
50,1000,700
90,1800,1200
100,2048,1556
Produces five keyframes at frames 1, 10, 50, 90, and 100 with the relevant x,y coordinates.
Tip: If you use a particular file format on a regular basis, you might want to create you own importer to parse the .txt file. You can use the <install_dir>/plugins/import_discreet.tcl file as a guide on how to do this.
To import tracking data:
1. | Add a tracking anchor as described in Adding Track Anchors. |
This adds a track to the tracks table in the Properties panel.
2. | Right-click the new track and select File > Import Time+value Ascii. |
The Import discreet dialog displays.
3. | Enter the file path and file name in the File field. |
4. | Set the required column containing the x and y coordinate data. |
5. | Click OK to import the track. |
The points from the file are converted into keyframes and displayed in the Viewer. The track between keyframes is interpolated as normal. The five keyframe example file described earlier produces a track similar to the following image.
Troubleshooting Keyframe Tracks
Again, even with preset keyframes, some sequences are inevitably going to cause problems. There are a number of pre-tracking checks you can perform to assist Auto-Tracking:
• Play through the sequence before placing your tracking anchors,
• Look for features that are consistent throughout the majority of the sequence,
• Avoid occluded features where possible - see Dealing with Occlusions.
Keyframe tracking won’t generally stop when a problem is encountered. Tracker attempts to continue using the next keyframe as a reference, which is why placing a lot of keyframes around problem areas is recommended.
Tip: Tracking areas of distortion or noise can produce unreliable results due to the movement of the pixels in the pattern matching box. One way to deal with this is to seed multiple tracks in and around the problem area and then average the resulting tracks together, producing a single more reliable track, by clicking average tracks in the properties panel.
1. | First, turn on the color-coded error indicator by clicking the traffic light Viewer tool. |
Each keyframe is colored on a sliding scale from green (good match) to red (poor match).
Bear in mind that a red keyframe doesn’t necessarily mean that the tracking result is poor, only that Tracker couldn’t reliably match the pattern from one keyframe to the next.
2. | Move the tracking anchor to the first of the poor frames, just about the center of the image in the example. |
3. | Tracker defaults to adding and deleting keyframes automatically when certain conditions are met, but you can toggle these features on and off in the Properties Tracker > Settings tab Keyframe Tracking controls: |
• re-track when keyframe is moved - disable this control if you plan to manually position multiple keyframes before re-tracking.
• re-track on creation of a new keyframe - disable this control when placing multiple new keyframes, such as when the track encounters problem areas.
• create new key when track is moved - you could disable this control if you wanted to use the zoom window to examine the sequence more closely without triggering a re-track.
• auto-tracks delete keyframes - when this control is enabled, custom keyframes are deleted during automatic re-tracking.
4. | Using the zoom window, drag the anchor to the correct location of the grabbed pattern. |
Tracker attempts to recalculate the track by including your correction.
5. | Advance the playhead to the next poor keyframe and repeat until the track is complete. |
Dealing with Occlusions
Tracker’s offset capability also applies to keyframe tracking, allowing you to track an obscured feature using the relative position of another feature, providing that the distance between the two points remains constant.
1. | Place keyframes normally until you reach the occlusion. |
2. | Play though the sequence to identify a likely offset point - a pattern that remains equidistant from the last keyframe. |
3. | Hold down Ctrl/Cmd and drag the tracking anchor to the offset position. |
The offset amount is recorded in the Tracks list and highlighted in yellow in the Viewer.
4. | Continue tracking as normal by clicking the track backward (Z) or forward (V) button. |
Tracker combines the two tracks into a single continuous track.
5. | Use the clear backward and forward buttons to clear poor keyframes. Click clear all to remove all selected tracks and keyframes, excluding manually placed keyframes. |
Note: You can reset tracking anchor pattern and search areas by clicking .