# Calculating 3D distances in a 2D image (Ideally with software)

If I have an image like the following and I know the area of the central hole ( ie c*d, say 35 m^2), how would I calculate the lengths a and b? Ideally using software rather than back-of-the-envelope maths, but the maths would be fine too.

• You can't. At the moment there is no relation between c, d and a, b.
– Paul
Commented Jun 8, 2020 at 18:34
• But can you see c is a certain proportion of a? If you measured the length of c in pixels and a in pixels, you could have for example a=1.4c. Same for d and b. Commented Jun 8, 2020 at 21:36
• even an approximate answer would be fine, it wouldn't need to be a completely exact solution Commented Jun 8, 2020 at 21:38
• Now you are creating a relation which is something to work with. If you can measure a and b directly though, why not do that?
– Paul
Commented Jun 8, 2020 at 21:39
• If you measure c, d in pixels (Say unit is px) then $cd px^2 = 35m^2$ so that $1px = \sqrt{\frac{35}{cd}} m$. Then if a is measured in pixels it has length $a \sqrt{\frac{35}{cd}}$ in metres.
– Paul
Commented Jun 8, 2020 at 21:45