From Three Dimensions to Two Dimensions
and Back

Missing newspaper story

The story is by now frighteningly familar -- aerial photographs taken by a high-flying surveillance aircraft or a satellite appear to show a facility that could be used to produce nuclear weapons, or biological or chemical weapons, or to train terrorists. Aerial photography has become an important tool preventing secret military build-ups and preparations for war. Mathematics plays a key role -- helping to analyze aerial photographs.

Missing photograph

Spy Plane

Missing photograph

Aerial Photograph

We live in a three dimensional world but we draw pictures and make photographs on two dimensional canvas and paper. The tools that we have been developing are exactly the tools that we need to go back-and-forth between the real three dimensional world and its two dimensional representations on paper and canvas. These tools are used by artists, cinematographers and military analysts.

This module has two parts.

These two problems are inverse problems. They describe the same situation in opposite directions. The first problem starts with a three dimensional scene and gives us a two dimensional picture with shadows. The second problem starts with a two dimensional picture with shadows and reconstructs the three dimensional scene. Inverse problems are extraordinarily important -- for example, in medicine, surgeons rely on two dimensional X-rays but they must operate on three dimensional people. Some of the most important advances in medicine have come from reconstructing a three dimensional picture of the inside of a person based on the two-dimensional shadows produced by X-rays.

We set up our axes as shown in the figure below. We will be looking down toward the ground from an airplane, or in the lab from a ladder or a chair. The point directly below us is the origin and the x- and y-axes will be laid out on the ground. The z-axis points upward so that we are looking at the scene from a point (0, 0, H) on the z-axis. The origin is on the ground, so points on the ground have coordinates of the form (x, y, 0).

Missing photograph

The best way to work through this module is using the real world as shown in the photograph below.

Missing photograph


Construct a similar "real world" at your workstation with the materials at hand. A bare light bulb makes the best light source because it creates very distinct shadows. Observe the way that the shadows change as you move the light source around. After you have experimented a bit by moving the light source around, fix it in one particular place. Measure the location of the light source carefully and measure the location of one particular point in the scene very carefully. Find the shadow cast by that particular point and measure its location carefully. We will show how to determine the location of the shadow mathematically and then we will check that this method works by looking at the measurements you have just made.


Suppose there is a light source located at the point represented by the three-dimensional vector S and that it illuminates an object located at the point represented by the three-dimensional vector P. As the light travels from the source to the object it follows the line described by

S + t (P - S)

as t goes from 0 to 1. If the light continued it would eventually hit the ground at a point of the form

(x, y, 0)

whose z-coordinate was zero because it was on the ground. You can find this point by looking the equation

S + t (P - S) = (x, y, 0)

For example, if S = (1, -2, 8) and P = (2, 1, 1) this equation becomes

(1, -2, 8) + t (1, 3, -7) = (x, y, 0)

which gives us three equations


   1 + t = x
-2 + 3 t = y
 8 - 7 t = 0

We can solve the third equation to determine t.


 8 - 7 t = 0
     7 t = 8
       t = 8/7

and then substitute this value for t into the first two equations to find the shadow (x, y, 0) of the object at P.


x = 1 + t = 1 + 8/7 = 15/7
y = -2 + 3 t = -2 + 3 (8/7) = 10/7



Next we consider how the scene appears to our viewer located at a point denoted by the vector

C = (0, 0, H)

directly above the origin. The viewer is looking straight downward toward origin. This is exactly the situation when a satellite or airplane takes photographs of the ground. We must find the photograph produced by a camera located at the point C. Consider an object located at the point P. Any other point on the line that goes from the viewer to the object will look exactly the same in the photograph. That is, every point of the form

C + t (P - C)

will appear in exactly the same place on the photograph. Without any clues that help us determine depth, every point looks as if it is on the ground -- that is, as if it is of the form (x, y, 0).



Now we know how to find the two-dimensional photograph that would be taken by a surveillance plane flying over a three-dimensional scene and we want to look at the inverse problem -- that is, we want to work backwards from a two-dimensional photograph to the three-dimensional reality. Use your own three-dimensional scene. When you start this part of this module you should have the following.

Theoretically, our problem is easy. Let P denote a particular point on the three-dimensional object, let V denote the location of the viewer and let L denote the location of the light source. Let G denote the place on the ground where P appears to be as viewed by the viewer and let S denote the location on the ground of the shadow produced by the point P. Consider the following example.


P = (3, 4, 5)
V = (0, 0, 105)
L = (-105, 0, 105)

Computations show that


G = (3.15, 4.20, 0.00)
S = (8.40, 4.20, 0.00)

We want to work backwards from V, L, G, and S to find P.

We know that P is on the line determined by the light source, L, and the shadow, L. Thus, P is of the form

P = t L + (1 - t) S

We also know that P is on the line determined by the viewer, V, and the apparent location, G, of P on the ground. Thus, P is of the form

P = s V + (1 - s) G

So we need to solve the equation

t L + (1 - t) S = s V + (1 - s) G

to determine s and t and then use s and t to determine P. In this example we get


t (-105, 0, 105) + (1 - t)(8.40, 4.20, 0.00) = 
s (0, 0, 105) + (1 - s)(3.15, 4.20, 0.00)
which leads to three equations in two unknowns


-113.40 t + 8.40 = 3.15 - 3.15 s
   4.20 - 4.20 t = 4.20 - 4.20 s
           105 t = 105 s
The second two equations are both satisfied if t = s and substituting t = s into the first equation we get


-113.40 s + 8.40 = 3.15 - 3.15 s
       -110.25 s = -5.25
               s = 0.04761905
               t = 0.04761905
which leads to


P = t L + (1 - t) S
  = 0.04761905 (-105, 0, 105) + 0.95238095 (8.40, 4.20, 0.00)
  = (3, 4, 5)
as expected.

Although this works out nicely in theory and even for this particular example, in practice it runs into a major snag as illustrated in the work below.


In practice, measurements are almost never perfect -- for example, in the problem worked out above if we had measured all the points we might very well have measurements like


G = (3.20, 4.20, 0.00)
S = (8.30, 4.30, 0.00)
Find the location of the point P using these values for G and S and the actual values of V and L used above. Explain. answer.

Using your own measurements, work backwards from the two dimensional data to reconstruct the three dimensional scene. Explain. answer.


Challenge Problem

Do the best job that you can starting with the data above


V = (0, 0, 105)
G = (3.20, 4.20, 0)
L = (-105, 0, 105)
S = (8.30, 4.30, 0)
to find the best estimate that you can for the location in three dimensions of the original point P. Notice that, as we saw above, you cannot find the point where the two lines

t L + (1 - t) S
s V + (1 - s) G
intersect because they don't intersect. But you can find the point that is closest to these two lines.

This is a very difficult problem but it is worth trying. We will solve this problem in Looking at a Three Dimensional World with Two Dimensional Eyes.


Copyright c 1995 by Frank Wattenberg, Department of Mathematics, Montana State University, Bozeman, MT 59717