# Determine Rotation from Camera

I'm trying to determine the rotation of a structure by mounting three LEDs in known locations then watching it with a camera.

The LEDs are arranged such that two are at either end of a line and the third is perpendicularly offset from the centre of this line.

The size of this shape is known but the camera doesn't output real world measurements so these dimensions can't be used directly - as a ratio perhaps.

Here is a diagram of the problem:

diagram

r, c, d are known and I am trying to find theta.

Thanks

• Sorry left out diagram... This is a single view problem. – user385736 Nov 22 '16 at 21:00

## 1 Answer

Assuming that the projection is parallel, we have

$$c=\frac a2\cos\theta-b\sin\theta,\\ d=\frac a2\cos\theta+b\sin\theta.$$

Then taking the ratio and simplifying

$$\frac cd=\frac{r-2\tan\theta}{r+2\tan\theta}$$ from which you easily get $\tan\theta$.

• Oh yes of course! Thanks for that, was staring at this for hours... – user385736 Nov 22 '16 at 21:36
• From 3 points it's not so easy to find localization of the camera, easier way is to use 4 co-planar LED's... and assuming that projection is parallel is rather a great approximation for camera... – Widawensen Nov 22 '16 at 21:54
• This problem is slightly out of context, it is part of a larger system which should work as I have found a paper showing it working... Could you show the simplification step? thanks – user385736 Nov 22 '16 at 23:13