0
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Do you know how to use the thin lens equation? $\endgroup$ – sammy gerbil Jun 8 '17 at 15:08
  • $\begingroup$ yes I know that equation. How can I use it for the case a real camera? $\endgroup$ – Hadi GhahremanNezhad Jun 8 '17 at 17:23
  • $\begingroup$ also look up 'photogrammetry' $\endgroup$ – Brad S Jun 8 '17 at 17:31
  • $\begingroup$ 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. $\endgroup$ – sammy gerbil Jun 8 '17 at 17:32
0
$\begingroup$

Using the Thin Lens Equation, with object distance and focal length, work out image distance behind lens. (Or do you already know the image distance from the lens = distance between lens and screen?)

Then the ratio of image to object heights = ratio of image to object distances. Finally, convert image height in inches to number of pixels, using the resolution q = number of dpi.

$\endgroup$
  • $\begingroup$ Thanks a lot. As in a physics point of view this works great. I hope I won't need to use the crop factor or sensor size or etc. By using your way, I can get the size of object in pixels. $\endgroup$ – Hadi GhahremanNezhad Jun 8 '17 at 17:51

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.