# Determining camera orientation (possibly using calibration images).

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.

Question:

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?

• You may wish to tag this under trigonometry. – Ron Gordon Jan 20 '13 at 13:43

## 1 Answer

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)}$$

• 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