Pi Robot demonstrates an improved head tracking algorithm in this
video while trying not to be distracted by the other actors in the
room. Comparing this video to Pi's very first video (also head
tracking), there are two differences: first, Pi's head movements now
anticipate the moton of the ball by a few video frames (about 100 ms)
by predicting its future position based on its current position and
velocity. As a result, Pi's head no longer lags behind the moving
ball as much as it did in the first video. Second, if the ball moves
completely out of Pi's field a view, a new "visual search" thread
kicks in that moves the head a large amount in the last known
direction of the ball. In this way, Pi is able to re-acquire the ball
even when it complete leaves his field of view.