# How to calculate the size of object in pixels, knowing the camera properties?

I'm trying to calculate the size of an object in pixels in an image, when I have these information:

x * y = the size of the real object in meters
q = the quality of the image in dpi
d = the distance between object and the camera in meters


Do I have to know the size of image as well? If so, how can I calculate the size of the object in pixels?

• Do you know how to use the thin lens equation? – sammy gerbil Jun 8 '17 at 15:08
• yes I know that equation. How can I use it for the case a real camera? – Hadi GhahremanNezhad Jun 8 '17 at 17:23
• also look up 'photogrammetry' – Brad S Jun 8 '17 at 17:31
• From object distance and focal length, work out image distance behind lens. (Or do you already know the image distance from the lens?). Then the ratio of image to object heights = ratio of image to object distances. – sammy gerbil Jun 8 '17 at 17:32