VideoObjectTracking
✖
VideoObjectTracking
detects objects of interest in video and tracks them over video frames.
corresponds to and tracks objects, assuming they are from video frames.
Details and Options




- VideoObjectTracking, also known as visual object tracking, tracks unique objects in frames of a video, trying to handle occlusions if possible. Tracked objects are also known as tracklets.
- Tracking could automatically detect objects in frames or be performed on a precomputed set of objects.
- The result, returned as an ObjectTrackingData object, includes times, labels and various other properties for each tracklet.
- Possible settings for objects and their corresponding outputs are:
-
{{pos11,pos12,…},…} tracking points as kposij {{bbox11,bbox12,…},…} tracking boxes as kbboxij {label1{bbox11,bbox12,…},…,…} tracking boxes as {labeli,j}bbox {lmat1,…} relabeling segments in label matrices lmati {t1obj1,…} a list of times and objects - By default, objects are detected using ImageBoundingBoxes. Possible settings for detector include:
-
f a detector function that returns supported objects "concept" named concept, as used in "Concept" entities "word" English word, as used in WordData wordspec word sense specification, as used in WordData Entity[…] any appropriate entity category1category2… any of the categoryi - Using VideoObjectTracking[{image1,image2,…}] is similar to tracking objects across frames of a video.
- The following options can be given:
-
Method Automatic tracking method to use TargetDevice Automatic the target device on which to perform detection - The possible values for the Method option are:
-
"OCSort" observation-centric SORT (simple, online, real-time) tracking; predicts object trajectories using Kalman estimators "RunningBuffer" offline method, associates objects by comparing a buffer of frames - When tracking label matrices, occlusions are not handled. They can be tracked with Method"RunningBuffer".
- With Method->{"OCSort",subopt}, the following suboptions can be specified:
-
"IOUThreshold" 0.2 intersection over union threshold between bounding boxes "OcclusionThreshold" 8 number of frames for which history of a tracklet is maintained before expiration "ORUHistory" 3 length of tracklet history to step back for tracklet re-update "OCMWeight" 0.2 observation-centric motion weight that accounts for the directionality of moving bounding boxes - With Method->{"RunningBuffer",subopt}, the following suboptions can be specified:
-
"MaxCentroidDistance" Automatic maximum distance between the centroids for adjacent frames "OcclusionThreshold" 8 number of frames for which the history of a tracklet is maintained before expiration - Additional "RunningBuffer" suboptions to specify the contribution to the cost matrix are:
-
"CentroidWeight" 0.5 centroid distance between components or bounding boxes "OverlapWeight" 1 overlap of components or bounding boxes "SizeWeight" Automatic size of components or bounding boxes
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Detect and track objects in a video:

https://wolfram.com/xid/0v59uv074crae-gfpxjl

https://wolfram.com/xid/0v59uv074crae-vs97nw

Detect and track faces in a video:

https://wolfram.com/xid/0v59uv074crae-jdw8dc

Extract the first frame from each sub-video:

https://wolfram.com/xid/0v59uv074crae-riszdq

Scope (7)Survey of the scope of standard use cases
Data (5)
Detect and track objects in a video:

https://wolfram.com/xid/0v59uv074crae-lul4mu

Detect and track objects in a list of images:

https://wolfram.com/xid/0v59uv074crae-6ozmzb

https://wolfram.com/xid/0v59uv074crae-32a8pt

Track a list of bounding boxes:

https://wolfram.com/xid/0v59uv074crae-h18er8


https://wolfram.com/xid/0v59uv074crae-ghf6bn


https://wolfram.com/xid/0v59uv074crae-2p5wr1


https://wolfram.com/xid/0v59uv074crae-o1x1rf

Track components in a time series of label matrices:

https://wolfram.com/xid/0v59uv074crae-5rokd6

https://wolfram.com/xid/0v59uv074crae-76lyw6


https://wolfram.com/xid/0v59uv074crae-mh4myi


https://wolfram.com/xid/0v59uv074crae-u2dyhs

Detectors (2)
Automatically detect objects and track them:

https://wolfram.com/xid/0v59uv074crae-sctuj4

https://wolfram.com/xid/0v59uv074crae-u2hl83

Specify a detector function to find objects:

https://wolfram.com/xid/0v59uv074crae-nvd231

Specify the category of object to detect and track:

https://wolfram.com/xid/0v59uv074crae-off8mb

Detect and track faces in a video:

https://wolfram.com/xid/0v59uv074crae-oyt6pm

https://wolfram.com/xid/0v59uv074crae-tia2d

Options (5)Common values & functionality for each option
Method (4)
"OCSort" (3)
In OCSort, motion is predicted using Kalman estimators. Higher values for "OCMWeight" increase the cost when boxes move away from the predicted positions.
Set up a problem with two sets of moving boxes:

https://wolfram.com/xid/0v59uv074crae-bng4tg

https://wolfram.com/xid/0v59uv074crae-baobxr

By default, direction of trajectories will be very flexible. Notice that in the region of large intersection between blue and red boxes, tracking may change direction suddenly:

https://wolfram.com/xid/0v59uv074crae-ncxhws


https://wolfram.com/xid/0v59uv074crae-r5is6b

Increasing the "WeightOCM" decreases chances of sudden direction changes:

https://wolfram.com/xid/0v59uv074crae-1f1svd


https://wolfram.com/xid/0v59uv074crae-jgy8go

The "IOUThreshold" suboption specifies a threshold for intersection over union between boxes in order to consider them as potentially the same object.
Set up a problem with a set of moving bounding boxes with a gap:

https://wolfram.com/xid/0v59uv074crae-qx20cy

A higher threshold for intersection splits the object trajectory into two parts:

https://wolfram.com/xid/0v59uv074crae-nx8576

https://wolfram.com/xid/0v59uv074crae-dp4lmp

A lower "IOUThreshold" merges the trajectories:

https://wolfram.com/xid/0v59uv074crae-bsk5om

https://wolfram.com/xid/0v59uv074crae-ns6w50

The "OcclusionThreshold" suboption deals with objects that disappear for some time (due to poor detection or occlusion).
Set up a problem with a moving bounding box and remove a couple of frames from the trajectory:

https://wolfram.com/xid/0v59uv074crae-e1cn5y

https://wolfram.com/xid/0v59uv074crae-wyn8lo

Without an occlusion threshold, the object is not re-associated to the tracklet once it re-emerges:

https://wolfram.com/xid/0v59uv074crae-b62dn3


https://wolfram.com/xid/0v59uv074crae-j7x2qw

With a higher occlusion threshold defined, the trajectory is linked back:

https://wolfram.com/xid/0v59uv074crae-bgpjqn


https://wolfram.com/xid/0v59uv074crae-gup1ky

"RunningBuffer" (1)
The "RunningBuffer" method can typically better track objects whose trajectories have a jump due to occlusion or fast movement:

https://wolfram.com/xid/0v59uv074crae-fv3sfz

https://wolfram.com/xid/0v59uv074crae-vuk3zk
The "OCSort" method results in different instances of the same hummingbird:

https://wolfram.com/xid/0v59uv074crae-66jw7

"RunningBuffer" links the trajectories together to track the bird as one:

https://wolfram.com/xid/0v59uv074crae-f6y0up

TargetDevice (1)
By default, if no detection function is specified, the detection is performed on CPU:

https://wolfram.com/xid/0v59uv074crae-c9jm1a

https://wolfram.com/xid/0v59uv074crae-8oyab0

Set the TargetDevice option to "GPU" to perform the detection on GPU:

https://wolfram.com/xid/0v59uv074crae-jv3fo8

Applications (12)Sample problems that can be solved with this function
Basic Uses (2)
Detect and track objects in a video:

https://wolfram.com/xid/0v59uv074crae-o64t3i

https://wolfram.com/xid/0v59uv074crae-txgpnr

Highlight objects on the video; notice all are labeled with their detected classes:

https://wolfram.com/xid/0v59uv074crae-k6x2ff


https://wolfram.com/xid/0v59uv074crae-3258k1

Highlight tracked detected objects with their corresponding indices:

https://wolfram.com/xid/0v59uv074crae-ii3xnd

Track labeled components from matrices:

https://wolfram.com/xid/0v59uv074crae-0t0kt4
Define a segmentation function that works on each frame:

https://wolfram.com/xid/0v59uv074crae-rp3ltc
Segment video frames and show components:

https://wolfram.com/xid/0v59uv074crae-vn4okf


https://wolfram.com/xid/0v59uv074crae-pdknvm

Track the components across frames and show tracked components:

https://wolfram.com/xid/0v59uv074crae-c93ugi

https://wolfram.com/xid/0v59uv074crae-5jmysq

Count Objects (3)
Count the number of detected objects in a video:

https://wolfram.com/xid/0v59uv074crae-ipucjx
Track objects and find unique instances:

https://wolfram.com/xid/0v59uv074crae-jlqiwm


https://wolfram.com/xid/0v59uv074crae-rutq61


https://wolfram.com/xid/0v59uv074crae-smtdkc

Count occurrences of a specific object:

https://wolfram.com/xid/0v59uv074crae-d5sfdu
Track objects and find unique instances:

https://wolfram.com/xid/0v59uv074crae-s2yc9


https://wolfram.com/xid/0v59uv074crae-zepsoc


https://wolfram.com/xid/0v59uv074crae-bqiib1

Count the number of elephants in a video:

https://wolfram.com/xid/0v59uv074crae-bz03eo

https://wolfram.com/xid/0v59uv074crae-nx9rnb

https://wolfram.com/xid/0v59uv074crae-g2b5xp


https://wolfram.com/xid/0v59uv074crae-kqfr1x

Extract Tracked Objects (1)
Detect and track the contents of a video:

https://wolfram.com/xid/0v59uv074crae-3uc5fu

https://wolfram.com/xid/0v59uv074crae-refli6
Extract the first of the detected labels:

https://wolfram.com/xid/0v59uv074crae-80zu60

Extract the sub-video corresponding to the first tracked object:

https://wolfram.com/xid/0v59uv074crae-lri0ne

Visualize Motion Trajectories (1)
Track pedestrians in a railway station:

https://wolfram.com/xid/0v59uv074crae-cfwxde
Detect the bounding boxes and show them over the original video:

https://wolfram.com/xid/0v59uv074crae-cqo96e


https://wolfram.com/xid/0v59uv074crae-92esa

Plot the trajectories of the centroids of the boxes:

https://wolfram.com/xid/0v59uv074crae-m91wsl

Overlay the trajectories onto the original video:

https://wolfram.com/xid/0v59uv074crae-0pg3sb

Analyze Wildlife Videos (3)
Track a herd of migrating elephants:

https://wolfram.com/xid/0v59uv074crae-8piho

https://wolfram.com/xid/0v59uv074crae-dgswnc
Highlight frames with the tracked elephants:

https://wolfram.com/xid/0v59uv074crae-ho2oli

Track a herd of galloping horses:

https://wolfram.com/xid/0v59uv074crae-h66pee

https://wolfram.com/xid/0v59uv074crae-msca2k

https://wolfram.com/xid/0v59uv074crae-en61mk

Track a flock of sheep entering a barn:

https://wolfram.com/xid/0v59uv074crae-ipcxa8

https://wolfram.com/xid/0v59uv074crae-h6vn0e

https://wolfram.com/xid/0v59uv074crae-bmza8z

Analyze Human Videos (2)
Estimate age from the face of each person in a video:

https://wolfram.com/xid/0v59uv074crae-ly6lx


https://wolfram.com/xid/0v59uv074crae-bwij5l

Find tracked faces with longest duration in the video:

https://wolfram.com/xid/0v59uv074crae-4kx9cp

Construct a timeseries of selected labels:

https://wolfram.com/xid/0v59uv074crae-4suku2

Compute estimated age for each tracked face:

https://wolfram.com/xid/0v59uv074crae-pfrra4
Compute median estimated age for each face:

https://wolfram.com/xid/0v59uv074crae-brzmvq

Track women dancing on the stage:

https://wolfram.com/xid/0v59uv074crae-cww4wd

https://wolfram.com/xid/0v59uv074crae-eqo62e

https://wolfram.com/xid/0v59uv074crae-jlz5z5

https://wolfram.com/xid/0v59uv074crae-c1nmab
Extract video of one of the dancers:

https://wolfram.com/xid/0v59uv074crae-mboul8

Determine the number of taps the performer makes:

https://wolfram.com/xid/0v59uv074crae-fhw7s0

https://wolfram.com/xid/0v59uv074crae-kd4842

https://wolfram.com/xid/0v59uv074crae-cd2bbz

Find the number of peaks that correlate with the jumps/taps:

https://wolfram.com/xid/0v59uv074crae-ina1tq

https://wolfram.com/xid/0v59uv074crae-dxlliy


https://wolfram.com/xid/0v59uv074crae-izclbb

Properties & Relations (1)Properties of the function, and connections to other functions
By default, ImageBoundingBoxes is used to detect objects. Use the YOLO V8 network from the Wolfram Neural Net Repository to perform the detection:

https://wolfram.com/xid/0v59uv074crae-b8nu4p
Retrieve the network and its evaluation function:

https://wolfram.com/xid/0v59uv074crae-vkvu35


https://wolfram.com/xid/0v59uv074crae-ylwzsr
Detect and track the object using the YOLO V8 network:

https://wolfram.com/xid/0v59uv074crae-dni4lx

Highlight the tracked detected objects:

https://wolfram.com/xid/0v59uv074crae-3v49d6

Neat Examples (1)Surprising or curious use cases
Track the motion of particles undergoing a random walk:

https://wolfram.com/xid/0v59uv074crae-shdnv
Extract the centroids of particles from the video:

https://wolfram.com/xid/0v59uv074crae-n060tf
Track the particles and extract the trajectories:

https://wolfram.com/xid/0v59uv074crae-qnc0sr
Plot the trajectories of all the particles:

https://wolfram.com/xid/0v59uv074crae-5urqw5

Visualize the motion of the particles with the longest trajectories:

https://wolfram.com/xid/0v59uv074crae-wlfrhz

Wolfram Research (2025), VideoObjectTracking, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoObjectTracking.html.
Text
Wolfram Research (2025), VideoObjectTracking, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoObjectTracking.html.
Wolfram Research (2025), VideoObjectTracking, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoObjectTracking.html.
CMS
Wolfram Language. 2025. "VideoObjectTracking." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoObjectTracking.html.
Wolfram Language. 2025. "VideoObjectTracking." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoObjectTracking.html.
APA
Wolfram Language. (2025). VideoObjectTracking. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoObjectTracking.html
Wolfram Language. (2025). VideoObjectTracking. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoObjectTracking.html
BibTeX
@misc{reference.wolfram_2025_videoobjecttracking, author="Wolfram Research", title="{VideoObjectTracking}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/VideoObjectTracking.html}", note=[Accessed: 15-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_videoobjecttracking, organization={Wolfram Research}, title={VideoObjectTracking}, year={2025}, url={https://reference.wolfram.com/language/ref/VideoObjectTracking.html}, note=[Accessed: 15-April-2025
]}