I'm going to set up some devices to perform real-time 3D motion tracking. My first idea to do so is to use a pair of cameras to take stereo image and calculate the depth map to get the 3D data I needed.
Are there any good open source libraries (C/C++) available and is fast enough for real-time(~12-24fps)? I've found 3D Reconstruction using Stereo Vision and EStereo in SourceForge, have anyone tried them?
Or any algorithm suggestion that I can implement?
How do we estimate depth? Our eyes estimate depth by comparing the image obtained by our left and right eye. The minor displacement between both viewpoints is enough to calculate an approximate depth map. We call the pair of images obtained by our eyes a stereo pair.
Given a pair of stereo images, to compute the disparity map, we first match every pixel in the left image with its corresponding pixel in the right image. Then we compute the distance for each pair of matching pixels. Finally, the disparity map is obtained by representing such distance values as an intensity image.
disparity = x - x' = \frac{Bf}{Z} x and x' are the distance between points in image plane corresponding to the scene point 3D and their camera center. B is the distance between two cameras (which we know) and f is the focal length of camera (already known).
Before you start, consider the fact that stereo vision is not just a software problem. The calibration of your pair of camera's is critically important to the accuracy of your depth map. For best results you want two identical camera's pointed exactly parallel, with exactly the same lenses on both cameras, with the CCD's of the camera's lying on one plane in 3D space. This is very difficult to achieve with just any random pair of camera's. Especially if they come from the cheaper segment.
If all you're interested in is using the 3D depth map for 3D motion tracking then there are precalibrated stereo camera's you can buy that typically come with software that allows you to extract the 3D map directly. I've had good experience with the Bumblebee camera from Point Grey Research but probably there are other good systems as well. This will allow you to concentrate on the 3D tracking. Otherwise just getting a usable depth map from a camera pair will eat up a lot of your time.
Opencv has a whole section on this, see chapter 12 of Learning Opencv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With