Can you measure real-world lengths from a 360° panorama or cube-map image?

Asked 11/19/2014

1 views

2 answers

0

I’m working with a 360° panoramic viewer built from a Ladybug camera’s six sub-cameras as a cube map. I can read cursor positions in the viewer/model space and I also have camera metadata such as origin, direction, up vector, and roll/pitch/yaw.

What I need to know is whether it’s possible to measure real-world distances in the panorama—for example, confirming that a table visible in the scene is 3 meters long.

Is a panorama image alone enough to recover object lengths, or do I also need depth/distance information and camera calibration data such as field of view, focal length, and sensor size? I’m looking for conceptual guidance on what is and isn’t possible rather than a complete implementation.

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

11y ago

2 Answers

2

The pano image is a 2-D projection of a 3-D space. As such, you cannot, directly, calculate object sizes from the image. At least, you'll need the object's distance (depth) from the camera. Knowing that, and your FoV, you can estimate the object's dimension perpendicular to the line-of-sight.

Practically, since the projection through the lens is not perfect, images of straight lines in space do not result straight lines on the image plan (i.e., the transformation is not affine). Theoretically, you could use this knowledge to some extent, to get a rough size assessment.


Update:

You need some kind of a reference to your measurements. If you want to measure the size of an isolated object, then the distance from camera and the FoV are required. For example, if your FoV is 90 degrees, the image size is 1000 pixels and the object measures 100 pixels, then you can calculate the object's angle-of-view is Am. Once you know it, and the distance of Dm meters, the actual Sm size is:

Am = 90 * 100 / 1000 = 9 deg    -- Angle of View
(Sm / 2) / Dm = tan(Am / 2)     -- the trigonometric equation
Sm = 2 * Dm * tan(Am / 2)       -- object's size

As you can see, the one measurement that you have from your image is the Angle-of-View (Am) of the object you are measuring. It is easy to see that an object of size 1 meter, at 3 meters away has the same image as an object of 2 meters at 6 meters away. This is why the distance to camera is crucial.

Note that the size calculated is only the perpendicular size!. We can't measure the radial size unless more information is given.

Your second option is using the known properties of a reference object. In your question, you mentioned a known size of a table, and a model size needs to be measured. If you know the relative positioning of the two with respect to the camera, i.e., how far is your model from the table (to make it simple, let's assume they are roughly on the same line-of-sight), then you can use that information to calculate the model's size.

For example, table is Ht = 3 meters wide, measuring St = 3 pixels. Model is Sm = 0.356 pixels, located dDm = 2 meters behind the table. Then, you can do:

At = 90 * 3 / 1000             -- table's angle of view
Dt = (Ht / 2) / tan(At / 2)    -- table's distance
Dm = Dt + dDm                  -- model's distance
Hm = Dm / Dt * Ht              -- model's size

If the model is not on the same LoS as the reference object, then dDm should be the radial difference in the distance from camera.

This is all very basic trigonometry, so if you are unfamiliar with the field, you can start your reading there.

I can imagine that in some research literature you will find that someone developed an esoteric method for assessing distance based on an object's "fuzziness" in the image, caused by the camera's limited Depth-of-Field (DoF), or something like that. Usually these cases work for a very specific and specialized equipment, that was precisely calibrated for taking the measurements.

Finally - if you can use two nearby cameras, or take two consecutive shots from nearby locations, you can generate a stereo-image which lets you estimate the object's distance from the object's images disparity (search for "generating a depth field from a stereo image").

Originally by user1024. Source · Licensed CC BY-SA 4.0

user1024

11y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Not from the panorama alone, at least not in general.

A panorama or cube map is still a 2D projection of a 3D scene. Image coordinates tell you viewing direction, but not how far away the object is. Without depth or some known reference, you cannot uniquely recover real-world length.

What you need depends on the case:

  • If you know the object’s distance from the camera, then with the camera’s field of view you can estimate its size, especially for dimensions perpendicular to the line of sight.
  • If you have a known reference object/scale in the scene, you may infer other measurements relative to it.
  • If you have true 3D information from multiple viewpoints or other depth data, then accurate measurement becomes possible.

Also, real lenses and panoramic stitching are not perfectly affine, so raw image measurements can be distorted. For reliable results you’d need proper camera calibration and projection geometry, not just viewer/model coordinates.

So: yes, measurement is possible only if you add some reference information such as distance/depth, known scale, or reconstructed 3D geometry. A single panorama by itself is insufficient for general real-world length measurement.

UniqueBot

AI

11y ago

Your Answer