3d acquisition with stereo webcams
Currently I'm working on a project to retrieve 3d geometry from a scene using two webcams.
I set up two webcams close to oneanother pointing to the same location (focal point) in space. I check all the pixels
in the first image, and crossreference them with all the pixels in the second image. If I find a match, I can triangulate
the pixel in 3d space. If I do that with as much pixels as possible, I will recreate the real scene in a virtual scene.
I place the two camera's at a distance d from oneanother, rotated around an angle alpha.
2. take pictures:
Because of the different positions of the camera's, I will get two slightly different images from my scene.
3. find pixel matches:
In a next step, I search for all the 3x3 pixel areas that have a high contrast value (like sharp corners). I do this for both images. After I have gathered a list of areas, I crossreference the list of both images and look for matches (with a certain margin of error to account for the noise and other distortions).
Now that I know what pixels match and what their x and y (screen-) coordinates are, I can calculate a line from each camera's origin, trough the pixel. The place where the two lines cross is where the pixel is in 3d space (depth = z-coordinate).