<i>"While the "how" behind it is no doubt complicated..."</i><p>Doesn't seem that complicated, really. The OpenCV book on the table is a nice giveaway to how it's put together.<p>After working with OpenCV for a while, it's an awesome and totally underrated project. I think anyone working on this new wave of apps (mobile, Kinect, etc) needs to know how to use this library.
Also see Visual Panel by Zhengyou Zhang. The problem basically is to find correspondences and then fit a planar homography between the input and the output surface.
[1] <a href="http://research.microsoft.com/en-us/um/people/zhang/VisualPanel/" rel="nofollow">http://research.microsoft.com/en-us/um/people/zhang/VisualPa...</a>