Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to write a program that can show the worth of a coin in an image.

I have already took care of finding radius of coins in pixel. But I am stuck here: if the image has been taken from a distance of h millimeters with angle of $90$ degrees, and lets say a coin in the image has radius of p pixels, how can I calculate the diameter of the coin ($d = p * 2$) in millimeters?

I just want to know the possible mathematical approach to solve this, the coding should be ok to do. Sorry if this question may not be related here.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You need to know the view angle of the lens used to take the photo. For example, Wikipedia gives the vertical angle of view of a 50 mm lens on 35 mm film (or equivalent sized CCD) as $27^{\circ}$. If the full height of the image is P pixels then the image is $2h \sin \frac {27^{\circ}}2$ high and the coin is $\frac pP 2h \sin \frac {27^{\circ}}2$ in diameter. This assumes the image has not been cropped. For other size sensors, often the focal length is quoted as 35mm equivalent and you can use the same approach.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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