Why does a pigeon's head bob as it walks?
Here is the footage slowed down by a factor of ten times, as you can see the pigeon throws its head forward very quickly and then it moves back slowly.
What the pigeon is actually doing as it moves its head back is keeping its eyes absolutely still compared to the world around it.
This is thought to make the job of processing visual information easier for the pigeon. If you walk along normally things move due to parallax, things close to you appear to move across things further away.
This is a nightmare of a task to decode (a task that machine vision scientists are still struggling with) and takes a hefty amount of processing power. Brains use a lot of energy so avoiding difficult processing reduces the amount of food you need to find to survive, so it appears the pigeon has used a clever mechanical trick to avoid the computation.
The head bobbing means that the pigeon's head is still so it can see things with no parallax, and then it quickly moves its head to another position where it doesn't move, this is obviously a bit of a trade off, as the pigeon can't see at all well while its head is moving forward, but considering the number of pigeons there are about it must be a successful tradeoff.
Similar tricks in humans
Although we can cope with parallax we do use some mechanical tricks to make visual processing easier. If you look at your eye in a mirror and then rotate your head around the eye, you should find that your eye rotates in its socket to keep the image horizontal, and therefore make identifying objects which are normally the right way up easier.
This is of course why you can read something easily if it is 30-40 degrees off horizontal, but if it is upside down it is a lot harder - your eyes can rotate only a certain amount and beyond that your brain has to do to rotation which is a lot harder work.
To find out more about head bobbing in pigeons:
The Optokinetic Basis of Head-bobbing in the Pigeon