Object Size Variation with Distance

We taped a poster on the wall:

and measured the width and height of the poster.

then we placed cameras on a cart and took a series of pictures at different distances and measured the distance from the camera to the wall for each picture. (see the associated MATLAB code vid2.m)

nearfar

The geometry of the camera is shown below.

The ratio of poster width (on the image) to focal length should equal the ratio of poster width (on the wall) to camera distance from the wall. See the plot below (and the associated MATLAB code vid2a.m)

The pixel size can be calculated if we know the actual focal length of the camera (which is embossed on the camera lens). The half field of view of the camera can also be determined, given that the half-width of the image sensor is 320 pixels (for a 640 x 480 format).

Now we generated a video of the cart moving toward the wall. Using the measurements made earlier, we should be able to calculate the speed of the cart.


Maintained by John Loomis, last updated 9 April 2010