1 | initial version |
It is possible, but except for specific cases, very difficult to do. The case of motion exactly in the direction of the camera is reasonably easy, but anything to the side is not so easy. This is an area of very active research, for example Google's Tango.
The best way to learn is to read the papers yourself and follow keywords and citations. Here's a good paper to start from, pretty simple and almost exactly what you want.
http://www6.in.tum.de/Main/Publications/Burschka2008a.pdf
Actually, this is a really good paper that I haven't seen before. I'm going to have to give this a try. Go ahead and read it, check the citations, use Google scholar to see who has cited it and explore.
A lot of the functions needed are in the Camera Calibration module. A lot of the others have to be written by you. I'm making a (slow) start on a module for OpenCV to do this quickly. Feel free to contribute HERE and take a look at what's already there.