2

I would like to calculate the angle of view of a photo taken by a smartphone, in order and estimate the distance from a subject of a specific size.

Let's do calculation for a Samsung S7, which has a 26mm focal length (source).

According to this source, the sensor size is 1/2.6", which means 5.5mm wide.

According to Wikipedia, the angle of view formula is: aov = 2*arctan(d / (2*f)) where d is the sensor width and f is the focal length.

2*arctan(5.5 / (2*26)) gives an angle of view of 12.1°.

It think it's a very small angle, so I took a pen and paper to get the calculate the distance from subject:

This gives tan(aov/2) = (s/2) / d, so d = (s/2) / tan(aov/2), where s is the subject size.

(1800/2) / tan(12.1°/2) gives a required distance of... 8.51 meters to take a full person (1.8m).

So I guess there is indeed a mistake here but I don't know where. I double-checked all my calculations and specifications sources.

I wrote a python script for calculations:

import math
subject_size = 1800
focale_length = 26
sensor_width = 5.5
angle_of_view = math.degrees(2 * math.atan(sensor_width/(2*focale_length)))
distance_from_subject = (subject_size/2) / (math.tan(math.radians(angle_of_view/2)))
print('angle of view: %0.2f°, distance from subject: %0.2fm' % (angle_of_view, distance_from_subject/1000))
# "angle of view: 12.64°, distance from subject: 8.51m"
roipoussiere
  • 123
  • 5
  • 2
    Welcome to Photo.SE. The way the SE networks work is that duplicate questions are discouraged. Have you searched existing questions here? We've already got about 50 different versions of this same question. – Michael C Sep 04 '19 at 17:45
  • 2
    I'm voting to close this question as off-topic because this is about using a camera as distance-finder rather than using a camera for photography. – mattdm Sep 04 '19 at 18:25
  • @MichaelC I searched a lot before posting here. Even with your comment in mind I can't find out those 50 versions of this question. But I'm new to photography so I guess my current knowledge doesn't allow myself to ask the very specific question related to my problem. – roipoussiere Sep 04 '19 at 20:41
  • @mattdm I though it was clear but I want to calculate the distance from subject in order to know where to place my camera. I do math before taking the picture. – roipoussiere Sep 04 '19 at 20:43
  • If you know that the subject is 5 feet tall...that doesn't in any way help you choose a lens and in no way informs your composition. It doesn't take into account the background, lighting, composition, etc...all of the things that make the photo. Do as we all do, grab a lens or two and just go shoot ;-). – OnBreak. Sep 05 '19 at 16:08
  • Sometimes when I follow a cook recipe, I spend hours to understand why, chemically speaking, some tasteless ingredient must be added to the cake. I spent hours to understand why, mathematically speaking, some music chords sound better than others. I know that my question will probably not help me to shoot a better photo. I want to understand what exactly happens when I take a selfie, from a optical point of view, so I did some calculations and found something weird, then I wanted to know why. I supposed that a Q&A website dedicated to photography was a good place to discuss about photography. – roipoussiere Sep 05 '19 at 19:43
  • you could try asking on the computer graphics SE https://computergraphics.stackexchange.com/ – user-2147482637 Jan 12 '20 at 14:47

2 Answers2

2

In this specific case, your error seems to be the result of using the 35mm equivalent focal length of the lens instead of the actual focal length of the lens.

Michael C
  • 175,039
  • 10
  • 209
  • 561
  • Thank you! It strange that none of the half-dozen of different website I browsed to check the focal length mentioned that 26mm was actually the 35mm focal equivalent. – roipoussiere Sep 04 '19 at 21:10
1

It is industry practice to state the focal length of miniature cameras in terms of how they compare to a 35mm film camera of yesteryear. I looked up the S7 and found the manufacture states focal length equals the performance of a 26mm, its actual focal length is 4.2mm. If you think about it, 26mm is just a tad over 1 inch. The focal length is the distance from a cardinal point of the lens barrel structure to the surface of the image chip. The S7 is not even 1 inch thick. Use a 4.2mm focal length and recalculate.

By the way: You will need to know the dimensions of the imaging chip exactly! The 35mm film format is 24mm height by 36mm length and the diagonal is 43.27mm Often the angle of view given is for the diagonal dimension only. Odd -- but TV and computer monitors are sold by diagonal size. Maybe not the most useful data but it yields the bigger number. For the full frame with a 26mm mounted Angle of view is:

46.6 degrees (height)

69.4 degrees (length)

79.5 degrees (diagonal) the one most frequently given.

Checking the size of a 1/2.6 imaging chip

3.81mm height

5.08mm length

6.35mm diagonal

Mount a 4.2mm lens angles of view are:

Height 48.8⁰

Length 62.3⁰

Diagonal 74.2⁰

Alan Marcus
  • 39,160
  • 3
  • 48
  • 91
  • Thank you for your answer. How do you get this 5.08mm length, given the 1/2.6" sensor size? The table I linked (http://photoseek.com/2013/compare-digital-camera-sensor-sizes-full-frame-35mm-aps-c-micro-four-thirds-1-inch-type/) refers to a 5.5mm length (I tried to calculate myself but 1/2.6" gives me 0.015mm so I don't understand how it works). – roipoussiere Sep 04 '19 at 20:56
  • Also, where did you get this 4.2mm actual focal length? Many different specification sources given me a 26mm focal length (and oddly none of them mentioned that this 26mm was not the actual focal length but the 35mm focal length equivalent) – roipoussiere Sep 04 '19 at 21:03
  • @roipoussiere 1/2.6" refers to the diameter of an old cathode ray TV tube needed for a TV camera with an imaging area with a 6.35mm diagonal. 1/2.6" is equal to 9.769mm. (1/2.6 inches x 25.4mm/1" = 9.769mm) – Michael C Sep 04 '19 at 22:26
  • 1
    I Googled the S7 and I know what to look for. You can do the same now that you know what to look for. The triangle you drew is the desired object triangle. A ray trace from the axis of the lens to the imaging chip traces out an image triangle. All angles of the two tringles are the same. The image tringle is tiny, the object triangle is large. They congruent. The base of the height of the object triangle is subject distance. The height of image triangle is the focal length. Try to envision these drawn apex touching apex. Now use trigonometry or you can use simple ratio math. – Alan Marcus Sep 04 '19 at 23:48
  • @MichaelC Thanks for the clue, but I don't understand your explanation. I read https://en.wikipedia.org/wiki/Sensor_size#Table_of_sensor_formats_and_sizes, where it's explained that the camera tube diameter would be 16mm, so I should multiply by 16: diam = 1/2.5 * 16 = 6.15mm, so width = 6.15*4/5 = 4.92mm and height = 6.15*3/5 = 3.69mm... not a 9.769mm neither 6.35mm diameter. – roipoussiere Sep 05 '19 at 08:43
  • @AlanMarcus I found a good drawing for this explanation (that validates my calculations): https://en.wikipedia.org/wiki/Angle_of_view#Derivation_of_the_angle-of-view_formula I just discovered that the angle of view formula I used was just the formula I wrote to find the object distance, but by isolating the angle. But I don't know why S2 and F are not the same... – roipoussiere Sep 05 '19 at 09:13
  • 1
    The light from the subject traverses the lens. Its path is changed due to the shape and density of the lens material. The path change is due to refraction (Latin to bend inward). The focal length F is the distance rear nodal (cardinal point) to image. This measurement is valid only for objects at an infinite distance away (∞). Since the lens has limited ability to refract. Objects closer than ∞ converge further downstream. Thus S2 is longer than F if the object is nearer than infinity, even longer if object is super close. If image of object is life size, S2 will be twice F. – Alan Marcus Sep 05 '19 at 15:01
  • @roipoussiere "The common 1" circular video camera tubes have a rectangular photo sensitive area about 16 mm diagonal." That's for a full 1" tube. A 1" tube has a 25.4mm diagonal, of which 16mm (roughly 63%) is available for imaging. 1/2.6" is 0.3846 inches or 9.769mm. Only 6.35mm (roughly 65%) would be available for imaging with a 9.769mm tube. 1/2.6" is less than one-half inch. – Michael C Sep 05 '19 at 22:35