Ask Your Question
0

Calculate the Object Distance from camera

asked 2016-04-06 13:14:10 -0600

Decapitary gravatar image

Ive read in this question that the object distance from the camera is

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

I have a HTC M9s and a red ping pong ball.In this variables I only know the real height of the object (mm) and image height (pixels) and object height (pixels)

but I dont know focal length (mm) or sensor height (mm).how can I find them? How much is this reliable?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-04-06 20:00:19 -0600

Tetragramm gravatar image

You can back out the information you need, if you can take a picture of the ball at a known distance from the camera. If you treat them as fixed (which they probably are as long as you don't change zoom or lenses on your camera), then it's one number, focal length / sensor height that is constant.

If you take a picture of your ball at a known distance, then you can solve the equation for the unknown constant, and then use that in all your future calculations. Measure carefully, or better yet, take multiple pictures at different known distances and average the results together.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-04-06 13:14:10 -0600

Seen: 6,936 times

Last updated: Apr 06 '16