views:

197

answers:

2

Given a picture taken by a simple digital that contains an image of a rectangle of known dimensions. How can I - to some degree of accuracy - determine the parameters of this camera?

I am mostly interested in Pan-, Tilt- and Swing angles. Optionally distance to the rectangle would be nice.

I acknowledge the fact that the focal length and resolution of the camera should be known, but it can be assumed that they are available (for example through exif metadata).

Are there any simple algorithms for this problems?

+2  A: 

What you are looking for are camera calibration algorithms. A commonly used one is Zhang's algorithm.

For more information regarding calibrating cameras, a good source is Hartley and Zisserman's textbook

jmbr
+1: Zhang's method works well, and Multiple View Geometry is a must read!
kigurai
I have seen Zhang's paper before and have discarded it as being to complicated on the math side :). So if you know of a source that can explain better I would like to hear about it. I have ordered Hartley and Zisserman, it should be in on friday thanks for that tip!
dwergkees
Unfortunately I don't recall Multiple View Geometry being much easier with regards to math than what the Zhang paper is.Computer vision in general really puts your math skills on test.
kigurai
True enough! However, by reading I came to the conclusion that, for my problem, it might be enough to only know the transformation matrix that caused my original rectangle (which I can measure in pixels) to the trapezoid in the image. (which can also be measured in pixels. This should reduce the number of parameters. Perhaps I should rephrase the question or ask a new one
dwergkees
I think opencv implements Zhang algorithm
Eric
If you have access to MATLAB try http://www.vision.caltech.edu/bouguetj/calib_doc/ . Remember when you calibrate your camera it works for only one focus of the camera (therefore auto-focusing must be disable)
srand
+1  A: 
Martin Beckett