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:


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


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

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$.

| cite | improve this answer | |
  • $\begingroup$ Oh yes of course! Thanks for that, was staring at this for hours... $\endgroup$ – user385736 Nov 22 '16 at 21:36
  • $\begingroup$ 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... $\endgroup$ – Widawensen Nov 22 '16 at 21:54
  • $\begingroup$ 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 $\endgroup$ – user385736 Nov 22 '16 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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