If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Mathematics of pinhole cameras

## Video transcript

in the last lesson we explored the geometric behavior of cameras we saw how light bounces off objects passes through a small hole or aperture and hits an image plane one of the important concepts we covered was depth of field which is a region where objects appear in focus outside that region objects appear blurry when appointed an image is out of focus it grows into a blurry circle known as the circle of confusion in this lesson we'll develop the algebraic equations which tell us exactly where things come into focus and how big the circle of confusion will be if something isn't in focus and these equations will allow us to create virtual cameras to create stunning images such as this shot to begin let's return to our pinhole camera as usual when bridging the gap between geometry and algebra we'll need to introduce a coordinate system it's convenient to choose our coordinate system so that the pinhole is at the origin right here and let's imagine that our scene is off to the right suppose the image plane inside our camera is at some distance to the left of the pinhole let's call this distance I now consider a point on some object in our scene call this point x0 y0 when light in the environment hits this point some of it will bounce toward the camera through the pinhole and hit the image plane let's call the place it hits the image plane x1 y1 so our first question is what is x1 and y1 one way to solve this is to use the slope-intercept form of a line the slope of the Ray is y 0 over X 0 and the y-intercept is 0 because we said this ray passes through the origin that is the equation of the Ray is just y equals y 0 over x 0 times X plus 0 or simply y equals y 0 over X 0 times X now the point we are looking for x1 y1 is also on this rate so it must satisfy that line equation meaning y1 equals y 0 over x0 times x1 and notice the diagram tells us that x1 is negative in a distance I away from the origen that is we know x1 equals - I finally to get y1 we just substitute to give us y1 equals minus y0 / x0 times i notice that the point y0 was originally positive but the corresponding point on the plane is negative and that's the image flip okay let's pause here to give you some experience with this before we add a lens to our camera