# How do I determine distance to an object when I know the object's size and the camera's angle of view?

I'm trying to find the distance of an object, where the original size of the object is known. Unfortunately, I cannot seem to find either focal length or sensor size online, but I know that the camera is 1080p and it seems to have a 75 degree diagonal field of view (from a quick google search). For reference, the camera is a Microsoft Lifecam Studio

Is there anyway to determine the distance, or anywhere to find the focal length or sensor size?

• A 1080p image (assumed to be 1980x1080p) has a 2200px diagonal
• If the diagonal field of view is 75° then a pixel is 75/2200=0.034° (or 0.000594 radians).
• So the angle of view of anything is measured_size_in_pixels × 0.034° or measured_size_in_pixels × 0.000594 rd
• And given the relation size/distance = tan(angle_of_view)(*), the distance is size ÷ tan(angle_of_view)
• For small angles, the tangent of an angle is very close to the measure of the angle in radians, so you can simplify to size ÷ angle_of_view.

If you put all that together:

distance = physical_size × 1683 ÷ size_in_pixels


when the size in pixels is under 200 pixels.

Of course all this is rather approximate and only works for objects that are nearly perpendicular to the camera axis (usually vertical measures are OK if the camera is held horizontally).

(*) actual is size/distance = 2 × tan(angle_of_view ÷ 2) but for small angles that won't make much difference.

• The Lifecam sensors were made by Omnivision; the OV9712 for lower level models. And the OVO2710 matches the known specs of the Lifecam Studio... 1920x1080 @ 3um Commented Jan 20 at 14:06

To calculate the physical size of object based on photo you need information about:

• Distance to Object
• Object height on sensor
• Focal Length

and the formula is

size of object = (distance * object size on sensor)/focal length


object size on sensor and focal length must be with the same dimension, millimeters for example.

As you do not have this information you can't calculate the size of object.

But if on the photo you have objects which physical size you know/can find you can relate them to the object in question. Here you can find a manual which can be helpful for you.