Skip to content

KCF tracking

Use a kernelized correlation filter to locate a learned appearance in a local search region.

Try it on your image ↓

VISUAL WALKTHROUGHMotion
REFERENCE INPUTTarget moves in the next frame

The previous position is a starting estimate, not the new target location.

RESULTUpdate the target box

Move to the response peak and update appearance.

STEP 03 / 03

Move to the response peak and update appearance.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Track an input rectangle into the second image with KCF.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Follow a single initialized object with relatively low CPU cost.

How it works

  1. 01Learn a filter from shifted versions of the target patch.
  2. 02Evaluate the response in the next frame.
  3. 03Move to the response peak and update appearance.

appearance correlation → response peak → new box

What to tune

Descriptor, kernel and learning settings control the appearance model. Check the update result before trusting the box.

Where it breaks down

Fast local tracking does not guarantee recovery after occlusion or large deformation. Re-detection is a separate task.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.