Friday, October 29, 2010

Different Perspectives on Projection

I've been studying for my upcoming PhD comprehensive exams, and my major topic is computer graphics.  Even though I haven't actually had the opportunity to take a class on graphics, I'm finding I've seen a lot of the material in the book I'm reading (Fundamentals of Computer Graphics).  One thing that struck me recently is the book's alternate approach to explaining perspective projection.

I learned projection based on the pinhole camera model while learning computer vision. The way to think of it is that light hits an object at point P, and some of it travels through the centre of the camera at point O.  Inside the camera is an image plane (Y1), which might be, for instance, film or a digital sensor.  The particular bit of light from P will hit the image plane at point Q.  When light is traced from each point on the object back to the image plane, an image of the object will be formed upside down.  The math behind figuring out exactly what the image will look like and where it will be involves similar triangles and the like.


Image from Wikipedia

This same concept, known as perspective projection because the final image will have perspective (parallel lines that don't look parallel) is still true in the Fundamentals of Computer Graphics explanation.  But in this case, we want to be able to express the projection in terms of an orthographic projection, something that was already established in the book mathematically.  Orthographic projection is when an image is created, but parallel lines stay parallel.  Architectural and model drawings are often drawn this way.

Objects further away look smaller with perspective projection (left), but not with orthographic (right)

An orthographic projection works by drawing a straight line from P to the image plane, where that line is perpendicular to the image plane.  It turns out that any point along the line that passes between O and P in the diagram above will appear on the image plane in the same place in a perspective projection.  So if we transform points on that line so that they now become perpendicular to the image plane, we can do an orthographic projection and get the same result (since all points on a line perpendicular to the image plane will appear on the image plane in the same place for an orthographic projection).

I enjoyed seeing perspective projection from this point of view; it actually helped me understand the geometry behind it all a bit more deeply.  It makes you wonder what other topics we could explain in two or more simple ways, and how many students would benefit from doing so.

0 comments:

Post a Comment

Comments are moderated - please be patient while I approve yours.

Note: Only a member of this blog may post a comment.