# Parallax: Seeing in Depth

Matt Strassler [June 4, 2012]

How do we detect depth — the distance from our location to another object? There are a few ways to do it, and one of the most common and easy to understand involves the geometrical fact of parallax. This extremely simple principle is used by our eyes and brains to form our three-dimensional “picture” of the world, and has been used by astronomers for centuries to determine the distances (or relative distances) from the earth to astronomical objects.

Another common way to detect distance involves sending out a wave [of sound, light, or something else] that travels at a known speed, and will bounce off an object and return to us; the time that it takes for the return of the wave — the echo — then tells us the distance to the object. This is the principle by which bats determine the distance to food and obstacles, and is also the principle of radar.

Fig 1: Two objects (red and violet) seen from three points of view (black dots); the top figures show the three arrangements of the objects and points of view as seen from above, while the bottom figures show the objects as seen from the corresponding point of view. At center, the point of view sees the red object as blocking the violet one. At right, the point of view is moved to the right; the faraway object appears to move by a smaller angle to the left, relative to straight ahead (black line in bottom right figure), than does the nearby red object. The reverse is true in the left figures, where the point of view has moved to the left and the objects lie to the right of straight-ahead.  The left and right figures also indicate the points of view of your left and right eye when looking at two objects that lie right in front of your nose, one behind the other.

We’re aware of parallax without even thinking about it, every time we move our heads. Think about what happens if a friend of yours is hiding from you by standing a few feet behind a large tree (Figure 1, center). If you move sufficiently far to the left or right, your friend will come into view (Figure 1 left and right). We all know it’s a simple matter of perspective; at a certain angle, the tree can no longer block your view of your secretive friend. But what’s going on geometrically is shown in Figure 1. As you move to the left and to the right, always staring straight ahead, nearby objects change their angle relative to what is straight in front of you faster than faraway objects do. So you can infer, from the rate at which the angle changes as you move — from motion parallax — how far away an object is.

Every child knows this, because when you look out the window of a moving car, the streetlights go flying by, the distant buildings travel past more slowly, and the moon, so far away that its angle relative to the viewer does not change perceptibly as the car travels down the highway, appears to travel along with the car. It is the small amount of parallax, due to great distance, that makes the moon “follow the car.”

And anyone who’s ever watched one of those old two-dimensional cartoons (and even many new ones) like the Flintstones knows that this fact is always used to show depth; as the characters travel in a car moving from left to right, the car is drawn stationary, the trees are drawn as one pictorial layer and move at high speed from right to left, and the hills in the distance are drawn as a second layer and move at lower speed from right to left.  See Figure 2.

Fig. 2: Illustration of Motion Parallax; angles to distant objects change  more slowly than angles to objects close by — and our brains can use this to create a sense of depth, even when the image we’re looking at is actually two-dimensional, as is this one! Original work by Natejunk2004; used under Creative Commons license.

Our own ability to perceive depth without even moving our heads is based on the same principle. Our left eyes and right eyes see the world from a slightly different angle. Just set up a couple of objects — doesn’t matter what they are, it could even be your two thumbs — so that one of them is twice as far away and sits directly behind the other. Now close your left eye and look out your right eye; then switch, closing your right eye and opening your left; then switch again, and again, back and forth — you’ll see that, just as in Figure 1, that both objects move, but your left eye will see the nearby object to the right of the farther object, and your right eye will see the nearby object further to the left.

So why do you perceive them, when both eyes are open, as being one behind the other? Because your optical system is a very clever information processor — a computer, of sorts. It creates for you, as a picture of the world, not what your eyes see, but rather a picture of the world that is derived in a complex way from what your eyes see. It’s the information from your two eyes combined together that (primarily, though motion parallax also contributes) allows you to perceive depth. Neither one of your eyes can detect depth when you are standing still; try closing your eyes, facing in a new direction, and then opening one of them. Can you really tell how far away things are? The world looks much flatter, much more two-dimensional, than usual. But with both eyes open you have no problem. This use of two images to create a three-dimensional map of the world is called “stereopsis”.

Even with only one eye open, you can still perceive depth pretty quickly — if you move your head. Your brain is able to use motion parallax, the more rapid change in angle of nearby objects relative to faraway ones, as you move left or right, to help recover some of the information about depth that would normally be provided by comparing the views from both eyes.    See Figure 2.

Fig. 3: If an object (violet) lies directly in front of your nose, your two eyes (black dots) located a distance R apart will see the object lying to the right and left of straight-ahead by the same angle, and from that angle the distance to the object can be easily found. The same principle allows finding the distance to a (not too distant) star, where the two black dots represent points of view of observers on the earth at times six months apart, when the earth lies on opposite sides of the sun in its orbit.

What’s the basic calculation that our optical system is using? The simplest case is shown in Figure 3. Suppose an object is directly in front of you. If your eyes are a distance R apart, and your left eye says the object is at an angle α to the right relative to straight ahead, and your right eye says the object is at an angle α to the left, then by simple geometry of right-angle triangles, the distance D to the object is

• D = (R/2) / tan α

You can see from this formula that when D is smaller, the angle by which the object’s apparent position deviates from straight ahead, for each of your eyes, is larger… that’s what we expect from parallax.

The more general case, shown in Figure 4, where an object is not directly in front of you, is a bit more involved to prove and ends up a bit more complicated in the geometrical formulas, but it involves the same basic principle and is not difficult in the end to actually calculate. Your brain does the calculation so rapidly (using a technique that we don’t precisely know yet) that you’re unaware of it.

For sufficiently faraway objects, the angle α is too tiny for your eyes and brain to perceive. And at that point your sense of depth is lost. That’s why the moon doesn’t seem closer than the stars; they’re all too far away for any sense of depth. Your depth perception typically isn’t good enough to tell whether an airplane will pass in front of or behind a distant mountain. But that’s just a limitation of your eyes.

How could you determine the distance to more distant objects? There are two options; develop a scientific instrument that can measure angles more precisely than your eye; increase R, so that rather than comparing the views from your two eyes, you are comparing the views from two cameras perhaps a few feet apart, or even halfway across the continent; or both. And when astronomers want to measure the furthest distances that parallax will allow, they even compare the views of a distant star taken six months apart, to get a distance R that makes use of the fact that the earth moves a great distance during the year. The details of the techniques vary, but the core principle is always the same as in Figure 3 (or Figure 4)… the principle of parallax.

Fig. 4: The trigonometry is a bit more complicated, but it is still straightforward to determine the distance D from your eyes (or any other two points of view) to a distant object, even if that object does not lie straight in front of your nose as in Figure 3.