While there are plenty of commercial stereo cameras available they all tend to be a bit expensive. We needed a stereo camera, just to start experimenting with the algorithms needed for depth estimation, so we built a really cheap one using two old webcams.
The final result ^
- 2x Logitech E3500 USB Webcam
- 1x Hammond 1599B project box (or similar)
- 1/4-20 unc Nut (for connecting to a tripod
- Super glue
- Small philips screw driver
- Drill with 12 mm, 6 mm, and 4 mm bits
- Circular file
Dismantle the two webcams by unscrewing the philips screw on one side of the webcam and prying apart the case. Unplug the microphone and small button from the camera PCB.
The camera has a detachable lens assembly. We will use this to our advantage by attaching the two lens assemblies to a project box and then using the existing screws to reattach the lens assembly to the camera PCB.
Position the cameras within the project box and mark the position of the lenses on the lid of the project box.
For each lens drill a 12 mm hole with two 4 mm holes for the alignment tabs on the camera lens assembly.
You may have to expand the holes slightly if they are not perfectly aligned.
With the actual lenses removed glue the two lens casings to the project box being careful to not get glue on the lens threads.
Screw the camera PCBs back to the lens casings.
Drill a hole in the bottom of the project box to allow a tripod to be connected. Use super glue to attach a 1/4-20 unc nut over the hole. This will allow most tripods to be connected to the camera.
Use a file or a dremel tool to create small notches in the project box and lid in order to slot the existing USB strain relief system into. Screw the project box back together.
Place the lenses back in their casings. The tighter the lenses are the further the focus point will be. They need to be quite tight. As a side note, these cameras are able to focus really close to an object.
Plug both the cameras into a computer. VLC can be used to view both the webcams. Open VLC and go to Media -> Open Capture device. Select direct show and then under "Video Device Name" select one of the webcams. Press "Play" to start showing the video. Open a second copy of VLC and repeat with the other camera. Adjust both the lenses so that they are focused at roughly the same distance.
The next steps are to calibrate the camera using OpenCV and to take our first stereo photo. This will be covered in the next build log.