Week 10 · Motion and tracking through occlusion

Keep a motion prediction during an occlusion and examine an identity swap.

← Week 9 · Subject contents · Week 11 →

Keep a motion prediction during an occlusion and examine an identity swap.

Work through the problem

A constant-velocity predictor advances x̂ₜ=xₜ₋₁+vΔt. When an object is occluded, the tracker has a prediction without a measurement. On reappearance, associate observations to predicted states. Nearest-last-position and nearest-predicted-position can choose opposite identities.

Object A moves from 2 at t=0 to 4 at t=1, while B moves from 8 to 6. They disappear at t=2 and reappear at [4,8] at t=3. The last positions favour matching A to 4 and B to 8. The velocity predictions are A at 8 and B at 2, which favour A at 8 and B at 4.

Run the Python lab

from itertools import permutations
previous,last,observed = [2,8],[4,6],[4,8]
for motion in [False,True]:
    forecasts = [b+2*(b-a) if motion else b for a,b in zip(previous,last)]
    match = min(permutations(observed),key=lambda p:sum((a-b)**2 for a,b in zip(p,forecasts)))
    print("Motion",motion,"forecast",forecasts,"assigned",match)
    if motion:
        assert match==(8,4)

Output from the lab

Motion False forecast [4, 6] assigned (4, 8)
Motion True forecast [8, 2] assigned (8, 4)

Practice

  1. What could help when both objects stop or change direction?

Check your reasoning

  1. Use appearance cues, keep several hypotheses, or increase uncertainty across missing frames.

← Week 9 · Subject contents · Week 11 →

Further reading · Szeliski · Computer Vision: Algorithms and Applications