I'm using a cell phone to capture an image of two objects (O1 and O2) on a flat plane and my camera is level with respect to this plane (the phone and the plane are both parallel). One of these objects (O1) is almost flat with a thickness of ~ 1mm and all of its dimensions (length and width) are known. This includes both its real-world size as well as pixel dimensions.

My objective is to find the dimensions of the other object (O2) in the image and the only thing I know for a fact is its height. I'd like to compute its length and width given this image. It is not as flat as the first object and as such, is closer to the camera. Thus, it appears to be slightly magnified in the image.

My question is this - since I do know how tall O2 is, is it possible to find its dimensions using O1's size, while taking into consideration that O2's dimensions in the image are magnified when compared to those of O1?

If there's a solution that will require taking two images or calibrating the camera, I'm open to those as well, but I'd prefer a method that is independent of these parameters. I've attached an image below that should help with visualizing the scenario.

Camera placement with respect to both objects.


The relationship between two objects of different sizes located different distances from the camera is determined by only one thing: shooting distance. More specifically, the distance between the camera's entrance pupil and the part of the object facing the camera. This is what is referred to as perspective.

For more, please see What does it really mean that telephoto lenses "flatten" scenes? In addition to discussing telephoto compression, the answers also have a couple of good visualizations that demonstrate perspective distortion at close distances.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.