Camera image in pixel to real image in meters size relation [closed]

first post so please be nice. I am doing an image processing project and my problem is now that I would like to know how big my digital image is in the real world.

I have: digital image: 336x256 pixel

camera focal length: 9mm

camara aperture: f/1,25

camera distance: 40m

pixel pitch: 17 micro m

FOV: 35° x 27°1.889 mr

Is there a way to calculate the real width and height of the image?

• I'm voting to close this question as off-topic because it is about using a camera as a measuring device rather than as a photographic tool. Mar 6, 2019 at 19:30
• @SebastianKo That's unfortunate. Can you point to where you were redirected from? Mar 6, 2019 at 20:38
• How is a question like this not considered part of technical photography? - Not all photography is about 'making pretty pictures', some of us deal with photography as a means to gather data for science and engineering or other purposes. Mar 6, 2019 at 21:57
• Even if this question is not off topic, it is certainly a duplicate of dozens of other more or less identical existing questions here. They're not that hard to find, even with SE's poor search engine. Mar 6, 2019 at 22:44
• Note: this question is being discussed on Stack Overflow's Meta site: meta.stackoverflow.com/q/380966/1709587 Mar 8, 2019 at 0:21

The actual focal length if the lens depends on the focus, so you cannot even trust was is reported in the EXIF data or even the markings on the lens. If the settings are repeatable (prime lens...) your best bet is to calibrate the image by shooting a known object (typically a rule/tape measure), and measuring its size in pixels in the resulting shot, and then apply a ratio when measuring object sizes in pixels in the subsequent shots.

In Gimp (and perhaps in other photo editors), you can specify an arbitrary pixel/physical length ratio, so with the proper ratio set the measure tool can give direct readings in physical units (meters/feet/cubits/furlongs...).

• Even prime lenses suffer from geometric distortion that make magnification slightly different in different areas of the image field. The also often suffer from focus breathing when different aperture settings are used (which affects the size of slightly out-of-focus objects). Mar 6, 2019 at 22:39
• Yes, but this can be corrected. Mar 6, 2019 at 23:00

In theory, yes (see zillions of other questions on this same topic, like this one), but in practice except in some constrained situations, not usefully. Digital cameras designed for making photographs do not make precise measuring devices.

• I read a little about cameras now. And as I understand it, can't I just multiple the pixel* pixel pitch to get the sensor size? Mar 6, 2019 at 20:51
• Well, given that you have the focal length and the angle of view, I think you can calculate the sensor size roughly as 5.67mm x 4.32mm... Or, based on pixel pitch and count, approximately 5.71mm x 4.35mm... Which actually agrees more closely than I expected... Mar 6, 2019 at 20:52
• That will give you an approximate size. Mar 6, 2019 at 20:52
• @twalberg Field of view and pixel pitch were edited into the question after I answered. Mar 6, 2019 at 20:54
• Ah... didn't review the edit history. Mar 6, 2019 at 20:56