Defined an object on photo observed at a certain angle. Appreciate its size.

There is a problem:
Given an object on photo observed at a certain angle. Appreciate its size.

How can I solve this problem with a computer vision and OpenCV?
I know about photogrammetry, which assesses the pictures, but I think that I'm not sure that it is that I'm looking for.
What can you suggest to me?
P.S. If possible, please provide your answer some examples of open source software or code, if anybody know.

But it's a complex problem covering as far as I know a lot of computer vision subjects. You can't really assume that, taking in consideration the fact that the real world is 3D + perspective, you have a simple linear transformation between 2D photo and the objects represented.