1 | initial version |
If you know the geometry of the object (ie, the locations of at least 4 visible points relative to each other) (more is better), then you can use solvePnP to get the orientation and distance.
If you know the camera's position and orientation in space from another data source, and can take multiple images from different positions, you can solve to get the distance.
If you spend a lot of computing power and build a structure from motion model of the scene, you can get the distance up to a scale factor. IE, you know it's 10.5 units, but you don't know how big the units are unless there's something in the scene you know the size of to use as a reference.