On the first day of the semester, my group affectionately named our robot "Pink iRobot" when one of our members (not me) came down with pink eye.
Among many other things, one thing we programmed Pinky to do (and unfortunately the only one I have footage of) was to follow an object.
How it works:
First, we show pinky what we want him to follow (here, the yellow card). Pinky takes note of exactly where the card appears in his visual field.
Then, Pinky moves himself a bit, and notes the location and the dimensions of the card in his visual field now after the move.
And since he knows how much he has moved, Pinky can calculates what dimensions the object must be based on the way the visual perspective has changed the location of the object's edges in the robots visual field using a triangulation formula (much like how our eyes and brain work together to use depth perception to see how close and large something is as we move towards or away from it).