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?