In object tracking, we want to know how well the model follows the object over time. Key metrics are Multiple Object Tracking Accuracy (MOTA) and Multiple Object Tracking Precision (MOTP). MOTA measures how many mistakes the tracker makes, like missing objects or wrong matches. MOTP measures how close the predicted object positions are to the true positions. These metrics help us understand both the correctness and the precision of tracking.
Object tracking basics in Computer Vision - Model Metrics & Evaluation
Tracking Confusion Matrix (simplified):
| Predicted Object Present | Predicted Object Absent |
------|--------------------------|-------------------------|
True | True Positive (TP) | False Negative (FN) |
False | False Positive (FP) | True Negative (TN) |
TP: Correctly tracked objects
FP: Tracker reports object but none exists
FN: Tracker misses an object
Total objects = TP + FN
Total predictions = TP + FP
Precision tells us how many tracked objects are actually correct. High precision means few false alarms.
Recall tells us how many true objects were found by the tracker. High recall means few missed objects.
Example: In a security camera, if the tracker has high precision but low recall, it rarely mistakes background for people but misses some people. If it has high recall but low precision, it finds almost all people but sometimes thinks shadows are people.
Balancing precision and recall depends on the use case. For safety, high recall is often more important to avoid missing objects.
Good tracking:
- MOTA close to 1.0 (near 100%) means very few errors.
- MOTP low error distance (small pixel difference) means precise location.
- High precision and recall (both above 0.8) means tracker finds most objects and rarely makes mistakes.
Bad tracking:
- MOTA below 0.5 means many missed or wrong tracks.
- MOTP high error distance means poor localization.
- Low precision means many false alarms; low recall means many missed objects.
- Ignoring ID switches: Tracker may confuse object identities, which hurts tracking quality but may not show in simple accuracy.
- Overfitting to training videos: Tracker works well on known scenes but fails in new environments.
- Data leakage: Using future frames or ground truth in training can inflate metrics unfairly.
- Accuracy paradox: High accuracy can be misleading if many frames have no objects (tracker predicts no object and is 'correct').
Your object tracker has 98% accuracy but only 12% recall on objects. Is it good for production? Why or why not?
Answer: No, it is not good. The high accuracy likely comes from many frames without objects, so predicting no object is often correct. But 12% recall means the tracker misses 88% of objects, which is poor for tracking. The tracker fails to find most objects, so it is unreliable.
Practice
Solution
Step 1: Understand object tracking purpose
Object tracking aims to keep track of where an object moves in a video over time.Step 2: Differentiate from other tasks
Classification sorts objects into groups, enhancement improves image quality, and edge detection finds boundaries in one image, not tracking movement.Final Answer:
To follow the position of an object across video frames -> Option AQuick Check:
Object tracking = follow object position [OK]
- Confusing tracking with classification
- Thinking tracking enhances image quality
- Mixing tracking with edge detection
Solution
Step 1: Recall OpenCV tracker initialization syntax
In OpenCV, trackers like KCF are created using the method cv2.TrackerKCF_create().Step 2: Check each option
tracker = cv2.Tracker_create('KCF') uses a non-existent method, C uses wrong method name, D tries to instantiate class directly which is incorrect.Final Answer:
tracker = cv2.TrackerKCF_create() -> Option DQuick Check:
OpenCV tracker init = TrackerKCF_create() [OK]
- Using wrong method names
- Trying to instantiate tracker classes directly
- Confusing createTracker with Tracker_create
import cv2
tracker = cv2.TrackerKCF_create()
frame = cv2.imread('frame1.jpg')
bbox = (100, 100, 50, 50)
tracker.init(frame, bbox)
success, box = tracker.update(frame)
print(success, box)Solution
Step 1: Understand tracker initialization and update
The tracker is initialized with a frame and bbox, then updated on the same frame.Step 2: Predict update output on same frame
Since the frame hasn't changed, the tracker will succeed and return the updated bbox coordinates (which may be the same as original but returned as a new tuple).Final Answer:
True and a tuple with updated bounding box coordinates -> Option BQuick Check:
Update on same frame = success True, bbox updated [OK]
- Expecting bbox to change without new frame
- Confusing success flag meaning
- Assuming syntax errors in correct code
import cv2
tracker = cv2.TrackerKCF_create()
frame = cv2.imread('frame1.jpg')
bbox = (100, 100, 50, 50)
tracker.init(frame, bbox)
success, box = tracker.update()
print(success, box)Solution
Step 1: Check tracker.update() method signature
The update() method requires the current frame as an argument to track the object.Step 2: Identify missing argument
The code calls update() without any argument, causing an error.Final Answer:
Missing frame argument in tracker.update() call -> Option AQuick Check:
update() needs frame argument [OK]
- Forgetting frame argument in update()
- Thinking bbox must be list not tuple
- Calling init() after update()
Solution
Step 1: Understand tracker characteristics
KCF tracker is known for good speed and decent accuracy, suitable for fast objects and limited resources.Step 2: Compare with other trackers
MIL and BOOSTING are slower or less accurate; CSRT is more accurate but slower and heavier on computation.Final Answer:
KCF tracker -> Option CQuick Check:
Fast object + limited power = KCF tracker [OK]
- Choosing CSRT for speed instead of accuracy
- Assuming BOOSTING is fastest
- Ignoring resource limits
Ready to prove it?
Pass the test and this pattern moves unknown
