Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to generate a camera calibration pattern. Cameras are expected to be placed at an average height of 15 to 30 feet above ground pointing downwards at roughly 30 degrees. These cameras are deployed in open spaced monitoring different types of movement. During installation, operators often make mistakes when entering camera height and angle information into our system.

The objective is to get a sense of the ground plane and to be able to calculate how close or far objects are relative to their size.

The only automated option I could think of was to have operators use a camera calibration pattern that have been printed on a large paper. The pattern image will be a simple black and white checkerboard with a constant number of rows and columns (let's say 10). The problem is, I will not know in advance what size the printed image is.

The variables are:

  • Height of the camera.
  • Angle of the camera to the ground.
  • Distance to pattern image.
  • Size of the pattern image.


How can I determine the size of the pattern image while analyzing (which will allow me to scale other objects in a relative way).

Is there a better way to approach this problem?

share|cite|improve this question
You may wish to tag this under trigonometry. – Ron Gordon Jan 20 '13 at 13:43
up vote 1 down vote accepted

I apologize for not having a picture. Let the height of the camera be $h$, the angle of the camera to the ground be $\theta$, the distance to the pattern image be $d$, and the size of the pattern be $s$. Consider the simple case where $\theta = 0$. Similar triangles reveals that the image size $t(0) = s h/d$. It should be noted that the light emanates from the camera at a half-angle $\phi = \arctan{[s/(2 d)]}$.

Now consider the tilted case. The system may be modeled with a triangle with angles $\theta$, $\pi/2 + \phi$, and $\psi = \pi/2 - (\theta + \phi)$. The side opposite the angle $\psi$ has length $t(0)$. We may then use the law of sines to find the image size $t(\theta)$:

$$\frac{t(\theta)}{\cos(\phi)} = \frac{t(0)}{\cos(\theta+\phi)} $$

With a little manipulation, we find that the image size is

$$t(\theta) = \frac{2 s h}{2 d \cos(\theta) - s \sin(\theta)} $$

share|cite|improve this answer
Thank you. What term would you use to google a sample image of such triangles? – Raheel Khan Jan 20 '13 at 14:11
Law of sines. Look, try to draw a picture of the situation and map it my description of the problem. – Ron Gordon Jan 20 '13 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.