I have used a structure from motion toolkit (VisualSFM) to calculate the position of 3 webcams.
I have then used the camera positions, rotations and focal lengths exported from this application to back-project a tracked IR Led (x,y) in each image to a ray in 3D space.
Where the rays generated from each camera intersect give the application the position (x,y,z) of the IR Led.
I have removed the IR filters from the webcams (£4.00 from Argos) and put a visible light filter over them instead (photographic negative).
This allows me to track the IR Led more precisely. I am using a very simple threshold on the image pixels, and the finding the average x,y of the remaining pixels.
The results are good, I haven't checked but I think I'm getting about 15 -20fps.
I have been warned before that because common webcams do not time-stamp frames that point localisation will be erratic, I don't see this. Didn't think it would be an issue for relatively slow moving objects.
The rays intersect fairly precisely, so the calibration looks good.
The next step will be to find the closest point to all the rays, to find the actual x,y,z, I'm expecting this to be a relatively straightforward bit of linear algebra (I hope!)
The system could theoretically scale to 10s of webcams, but I will have to sort out adding more USB buses to my PC.
The cameras would be placed further apart, but I still need to order some USB extension cables from the internet, the high street is way too expensive!
The code is in C#, using AForge for webcam access and XNA for visualisation.
The aim of all this is to get cheap accurate and fast absolute position tracking out to the world (If indeed such a thing is currently possible)(and also because I want to play with the oculus in a real VR space).
I can supply further details and will be setting up a github project shortly, I'd like to put it on my CV
![Smile :)](./images/smilies/icon_e_smile.gif)
Bring on the Oculus!!!
![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
There is an image along with this post, a quick explanation:
The three windows at the top are the webcam feeds. The little red boxes are the tracked locations of the IR Led I am holding in each image.
The bottom window is an XNA game window. The big guns (The only mesh I had to hand) near the camera are the webcams, the way they are facing reflects the way the webcams are facing.
The lines coming out of the guns are the rays projected from the camera centre through the tracked IR Led pixel coordinates. Where the lines intersect is the estimated location of the IR Led. The little guns in the background are the image points used in the camera calibration step from VisualSFM, they are mostly of the cushiony side of the sofa(more texture there). The really big gun is attached to me (actually the third webcam position is obscured by the really big gun, but ho hum).