Forgotten in its old age

by Aditya

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

Possible Duplicate:
Calculate object size when I have physical pixel size

I am working on the following formula to calculate distance of object from camera:


distance to object (mm) = focal length (mm) * real height of the object (mm) * image height (pixels)
                         ---------------------------------------------------------------------------
                                         object height (pixels) * sensor height (mm)

all other parameters are known except object height in pixels?

share|improve this question

marked as duplicate by mattdm, John Cavan, jrista Dec 24 '12 at 19:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Wait, hold on — do you mean "how do I find out what the height in pixels of a given object is?" –  mattdm Dec 22 '12 at 13:08

1 Answer 1

That's going to sound amazingly simple but open the image in your image editing software of choice (e.g. The GIMP), pick the "Select" tool, and select a rectangle encompassing your "object". In The GIMP, the size of the select box is displayed in the status bar at the bottom. There you go. Object height in pixels :)

share|improve this answer
    
I think he means how many pixels <i>will</i> some object be in size given the distance from the camera, the focal length, and size and resolution of the sensor. –  Olin Lathrop Dec 22 '12 at 17:20
1  
@OlinLathrop : "I am working on the following formula to calculate distance of object from camera". So the distance is not known, but all other parameters should be. –  matt.nguyen Dec 22 '12 at 17:36
1  
Yeah, I kind of think so too, which in my mind makes this a silly question. (To which this is the right answer.) –  mattdm Dec 22 '12 at 19:07

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