# How to determine the required resolution to view an image at a certain size?

If I have several camera specifics, can I determine the required resolution to view an image at the size I want?

For example, let's say I want a picture of a square painting to be at least 20 pixels large. I know the focal length is 7.5 mm, the painting was 8 m away from the camera, it is 2 m tall in real life. I know that the image sensor is 2.4 mm by 2.4 mm. Can I determine the required resolution to view the painting at least 20 pixels large?

-
Sure, and it is basic math if you understand the definitions of all the terms you used. –  Kris Van Bael Sep 23 '11 at 18:20
I do understand the definitions of the terms I used, and I figure it should be possible, but I'm not familiar with the relationship between those and the resolution. Thus my question.. –  headphones Sep 23 '11 at 18:34

In general, the ray height in the image plane $h$ is given by

$$h=f \tan{\theta}$$

Where $f$ is the focal length and $\theta$ is the ray angle in object space. All the angles and heights are measured from the optical axis.

$$\theta = \tan^{-1}{\frac{H}{D}}$$
Where $H$ is the height of your object and $D$ is the object distance. Therefore, you have
$$h = f \frac{H}{D}$$
Plugging in the numbers, your image will have a height of 0.9375mm, so to have that cover 10 pixels, (remember the height is from the center of the image, not the bottom, to the top) you will need pixels with a spacing of $\frac{0.9375}{10} = 0.09375 \text{ mm}$, or $93.75\ \mu m$