# How to estimate pixels per degree for an image from a camera phone using EXIF data?

This is my first time to look at metadata and I'm confused by the focal length stated in this file that a friend e-mailed to me. It was taken with a cell phone.

I'm trying to roughly estimate the angle in degrees that corresponds to a width of 400 pixels in the 4096 × 2304 pixel image. If the no zoom was used, the focal length is 3.5 mm, the diagonal of 1/3.1 inch or 8.19 mm corresponds to 4700 pixels, and using trigonometry the angle from the center to the corner is about 49.5 degrees corresponding to 2350 pixel half-diagonal, giving roughly 47.5 pixels per degree. I used `(180/pi) * arctan2(8.1935/2., 3.5) = 49.5`

But when I look at the metadata for the image I see `Digital Zoom Ratio: 1.4`.

I am thinking that the image on the phone was zoomed by hand on the touch screen, and so I need to use a different focal length for my calculation.

Should I multiply the 3.5 mm focal length by a factor of 1.4 and then use the same math, getting a new estimate of about 39.9 pixels per degree? `(180/pi) * arctan2(8.1935/2., 3.5*1.4) = 39.9` Or am I missing something? I assume this is a still frame from a video, because 16:9 is a common video ratio. In order to maintain constant frame size, "digital zooming" needs to be reinterpolated. Thus, yes, you need to account for the "zoom ratio" by factoring in 1.4 times the focal length.

However, your calculations are off, because a "1/3.1-inch" sensor is not actually 1/3.1" in dimension. This is understandably very confusing, but it is merely a nomenclature referring to old circular 1" video tubes, which had a useful diagonal of about 16 mm, far from the actual 25.4 mm in an actual inch. See also, Why is a 1" sensor actually 13.2 × 8.8mm?

It took a little bit of Google searching, but I found the Sony Experia XA (Sony F3115) has a Sony EXMOR IMX258 sensor. Wikipedia's EXMOR article says the sensor is a 1/3.06" format, with a diagonal of 5.867 mm, and a pixel pitch of 1.12 µm. At 3.5 mm (the lens focal length), a 1.12 µm pixel subtends atan(0.00112 / (3.5 * 1.4)) = 0.0131°. Or if you prefer, 1/0.0131 = 76.4°/pixel at the center of the image. This distinction is important because near the edges, a 1.12 µm distance subtends a smaller angle — this is the nature of the tangent function.

A 400-pixel region subtends an arc of 2 * atan((0.00112 * 400 / 2) / (3.5 * 1.4)) = 5.23°

Normally, a very useful reference is Wikipedia's table of sensor format and sizes. Unfortunately, it doesn't list a 1/3.06" sensor. It does list a 1/3.09" Sony EXMOR IMX351 sensor, which is fairly close though.

• Thank you for the thorough answer! So I should assume that the image is not re-interpolated for size, and pixels in the image correspond to pixels on the sensor; the more the user zooms, the fewer pixels in the resulting image? I'm a little confused about the "Digital zoom ratio" then, if the total number of pixels in the image reduced by 1/1.4 then should I think of that as a zoom of 1.2x (square root of 1.4)?
– uhoh
May 26, 2020 at 2:38
• @uhoh It seems fair to assume it's not reinterpolated for size. I can't say for sure, but to me it wouldn't make sense to reinterpolate it. That results in a larger file size for no gains. IMO.
– scottbb
May 26, 2020 at 2:42
• Okay thanks; I'll ask the person to do some experiments to confirm. It may take a day...
– uhoh
May 26, 2020 at 2:45
• @uhoh re: zoom ratio of 1.4 vs 1.2... well, I don't know. "Digital zoom" isn't really a standard thing. Certainly, I would call it a 1.2 crop if done in post. However, I just noticed something: the 4096x2304 image has a 16:9 ratio, whereas the IMX258's pixel count is 4224x3136, a 4:3 ratio. Taking the "pythagorean crop" of the two image areas, I get a crop of 1.12. Hmm.
– scottbb
May 26, 2020 at 2:49
• @uhoh I can confirm that at least one phone with IMX258 (Samsung Galaxy A320F/DS) does make photos in this truncating way: it takes a 16:9 "top" (i.e. not the middle; landscape orientation implied) part of the raw data and gives zero values for the rest. Moreover, if I choose the "native" resolution (i.e. 4128×3096 instead of 4128×2322) in Open Camera, the JPEG shot comes out additionally cropped on the sides and upscaled to fill this native size. May 26, 2020 at 9:12