Motion tracking

On this page 7

Motion tracking is the process of measuring how chosen features, a surface or the camera itself move through a sequence of video frames, so that graphics, effects or corrections can follow exactly the same motion. In motion graphics and VFX it is the bridge between recorded footage and anything added later: a screen replacement, a sign in a different language, a blurred license plate or a computer-generated creature standing on a real floor.

The result of tracking is numerical motion data, usually a position, rotation and scale per frame or a full three-dimensional camera path. That data drives other operations such as compositing, rotoscoping masks or stabilization, which is why tracking quality decides whether an added element looks locked to the scene or visibly floats.

How motion tracking measures movement

Most trackers work by pattern matching between frames. The artist places a search region around a high-contrast feature, the software stores that small image patch as a reference pattern, and on every following frame it searches a larger search area for the position where the patch matches best, typically by minimizing a difference score or maximizing a normalized correlation.

Good trackers refine the match to subpixel accuracy by interpolating the correlation peak, often to a tenth of a pixel or better. They also report a confidence value per frame, which drops when the feature blurs, leaves the frame or is hidden by a foreground object. That value tells the artist where to add manual corrections.

Feature-based and planar trackers differ in what they follow. A point tracker follows one small patch; a planar tracker follows a whole flat surface and solves a homography, the eight-parameter transform that maps one perspective view of a plane onto another. A 3D camera tracker (also called matchmoving) follows hundreds of features and solves the camera position, orientation and lens from their combined parallax.

The following table summarizes the main stages of a typical tracking job and what each stage produces.

StageWhat happensOutput
Feature selectionArtist or software picks high-contrast corners or texturesTrack points or regions
Frame-to-frame matchingEach pattern is searched for in the next frameRaw 2D positions per frame
RefinementBad frames are corrected, jitter is filteredClean 2D tracks
SolvingTracks are converted into a transform or cameraCorner pin, 2D transform or 3D camera
ApplicationData is linked to graphics, masks or stabilizersElement that follows the shot
Stages of a tracking job

Types of motion tracking

The right type of tracking depends on how many degrees of freedom the added element needs. A caption that only follows a moving object needs position; a phone screen replacement needs perspective; a digital building in a moving aerial shot needs a full 3D camera solve.

Tracking typePoints neededRecovered motionTypical use
One-point tracking1Position onlyLabels, simple attachments
Two-point tracking2Position, rotation, uniform scaleObjects that turn or move toward camera
Four-point corner pin4Perspective of a planeScreen and sign replacement
Planar trackingA textured regionHomography of a surfaceWalls, tabletops, faces of buildings
3D camera trackingDozens to hundredsCamera path, lens and scene pointsCG objects and set extensions
Object trackingMany points on one rigid objectObject pose in 3DProps, vehicles, heads
Common tracking types and their use

A practical rule is to use the simplest type that captures the needed motion. Every additional degree of freedom adds a chance for noise, so a two-point track on a shot that only pans can introduce rotation jitter that was never in the footage.

Motion tracking is often confused with neighboring operations in the same pipeline. Its specific job is to measure motion, while the related techniques either use that measurement or estimate motion in a different way.

TechniqueCore questionRelationship to tracking
Motion trackingWhere does this feature or camera moveProduces the motion data
Optical flowHow does every pixel move between framesDense estimate, used for retiming and warping
RotoscopingWhere is the outline of this objectMasks are often driven by tracking data
KeyframingWhat value should a property have at this timeTracking replaces manual keyframes with measured ones
CompositingHow are layers combined into one imageUses tracking to keep layers aligned
StabilizationHow can unwanted movement be removedApplies inverted tracking data to the shot
Tracking and neighboring operations

The distinction from optical flow matters most. Tracking follows a sparse set of chosen features and is robust over long sequences, while optical flow estimates a dense vector field between neighboring frames and tends to drift when applied over many frames.

Preparing footage and choosing settings

Tracking succeeds or fails largely before the software is opened. On set, crews place tracking markers, small high-contrast crosses or dots, on green screens and featureless surfaces, and record lens focal length, sensor size and camera height for the 3D solve.

  • Shutter angle of 180 degrees or less keeps motion blur short enough for reliable matching.
  • Lens distortion must be measured, usually with a grid chart, and removed before a 3D solve.
  • Rolling shutter skew from CMOS sensors bends straight lines during fast pans and confuses solvers.
  • Parallax is required for a 3D solve; a pure nodal pan only supports a rotation-only solution.
  • Pattern and search sizes should match the feature size and the fastest movement in pixels per frame.

Quality is judged by the solve error, the average distance in pixels between tracked features and their reprojected positions. Values below about 0.5 pixel are generally considered good for high-resolution work, while errors near or above one pixel usually produce visible sliding, although the acceptable limit depends on resolution and on how closely the added element touches real surfaces.

Common tracking problems and how to fix them

Most tracking failures come from a small set of recurring causes. Recognizing the symptom early saves hours of manual keyframing later.

SymptomLikely causeFix
Track jumps to a wrong featureSimilar pattern nearby or occlusionSmaller search area, manual correction
Slow drift over timeReference pattern updated each frameTrack from a fixed reference frame
Jitter in the resultLow contrast, noise or compressionDenoise a proxy, smooth the curve lightly
Element slides on the floorUncorrected lens distortionUndistort, solve, then redistort
Solve fails or flipsNo parallax or too few featuresAdd features, give the solver focal length
Wobble during fast pansRolling shutter skewApply rolling shutter correction first
Tracking symptoms, causes and fixes

A frequent mistake is over-smoothing a noisy track. Heavy smoothing removes jitter but also removes real camera shake, so the added element appears to float against the background. The better approach is to improve the source track and smooth only the remaining noise.

A non-technical view

Motion tracking is a way of teaching the computer to watch a spot in a video and remember where it goes. Imagine putting a fingertip on a moving car in a film and following it frame by frame. The computer does the same thing, but with far more precision and patience.

Once the computer knows how that spot moves, anything added later can move along with it. A logo can sit on the side of the car, a blurred patch can stay over a face, or a digital object can appear to stand on a real street. When tracking is good, nobody notices it; when it is poor, the added object seems to slide around.

A concrete example

A small post-production team receives a handheld interview shot at 3840 x 2160 and 25 frames per second. A laptop screen behind the speaker shows confidential data that must be replaced with a neutral interface. The camera drifts slightly and the speaker’s arm passes in front of the screen several times.

The compositor uses a planar tracker on the laptop lid, which has visible texture around the screen edges, and masks out the arm so it does not disturb the solve. The resulting corner-pin data drives the replacement image, and a rotoscoped mask of the arm keeps it in front of the new screen.

After correcting three frames where motion blur weakened the track, the replacement holds within a fraction of a pixel. The final shot shows a convincing, stable screen replacement that moves naturally with the handheld camera, and the edit is delivered without reshooting.