|
MinoruWebcam
The first commercial stereoscopic webcam
IntroductionThe Minoru is the first commercially available stereo webcam. It's primarily intended for entertainment - broadcasting stereo anaglyphs as a novel alternative to the usual webcam based video conferencing or blogging. However, it also makes a good inexpensive range sensor for robotics use. DisassemblyThe Minoru comes in a casing which is attractive, but not very easy to mount onto a flat surface. The outer casing can be removed as follows:
SoftwareThe Minoru is UVC compilant, and therefore very easy to use on a GNU/Linux operating system. Plug in the camera, then open a command shell and type: ls /dev/video* This should display two extra video devices. If you are using a kernel with a version earlier than 2.6.30, obtain the latest UVC driver from here then install it (possibly you might need to reboot for the new driver to take effect). You can test out the webcam using a program called v4l2stereo, which is part of a project called libv4l2cam which is related to the Sentience project, and is also under the General Public License. A deb package is available for easy installation on Debian based distros. v4l2stereo can be used in various ways, but to check that the Minoru is working you can use the following command. v4l2stereo -0 /dev/video1 -1 /dev/video0 --features This assumes that the left camera is video device number 1 and the right camera is video device number 0, and should display two images showing the edge features which are the basis for stereo matching, like this:
So, once you have established that the cameras are working the first thing to do is calibrate them using the --calibrate option. This performs simple offset calibration, and not full camera calibration (which can be done using other programs). This type of calibration simply corrects for any small deviation of the two cameras from a perfectly parallel alignment. First quit v4l2stereo if it's still running by hitting the Escape key, then point the Minoru at some distant objects - preferably more than three metres away (i.e. beyond the effective stereo range) - then use the following command. v4l2stereo -0 /dev/video1 -1 /dev/video0 --calibrate This will take a couple of images from the cameras, calculate the offsets then display them. Take a note of the values which are returned. You may wish to go through this procedure several times in order to ensure that the values returned are reasonably consistent. Once you're satisfied that you have good offsets you can test stereo correspondence as follows: v4l2stereo -0 /dev/video1 -1 /dev/video0 -x 8 -y -4 --matches where x and y are the offset values obtained from calibration. An example result looks like this.
The diameter of the green dots represents the amount of visual disparity observed between the left and right camera images. There are always a certain number of bad stereo matches, but hopefully there should be more signal than noise. You can also examine the disparities by using the --histogram option, which will display a number of disparity histograms (left hemifield, right hemifield and entire field of view). The disparity peaks observed within the left and right hemifields could be used as a simple way of having a robot visually avoid obstacles, and the correspondence algorithm is easily fast enough for real time performance on any reasonably modern PC hardware.
The effective stereo range of the Minoru, using 320x240 images, is between 35cm and 2 metres. The range is limited mainly by the baseline distance between the cameras and the image resolution. For close up tasks such as manipulation or inspection of objects this might be quite a useful off-the-shelf sensor. DevelopmentIf you wish to do development on the v4l2stereo code you will need to ensure that opencv is installed, as follows: sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev libcv-dev libcv1 libcvaux1 libcvaux-dev libhighgui1 libhighgui-dev Other things to tryOne limitation of the Minoru is that the field of view is quite narrow - only about 40 degrees - giving it a tunnel vision which is fairly standard for webcams. For robotics use a wider field of view would be preferable, and it may be possible to replace the lenses (M12 fittings which screw in). v4l2stereo includes options which allow you to rectify the images if the camera calibration parameters are known. After searching around and trying a few different lens types I found that the following specification works well. Angle of view: 180 degrees Focal length: 1.8mm Back focal length: 5.44mm Format: 1/3", 1/4" Aperture: F2.0 The most important figure here is the back focal length, which is the distance between the back of the lens and the CCD or CMOS sensor. If this is longer than about 7mm then the lens will usually not fit into the short lens mountings on the Minoru, which are only about 10mm in height above the circuit board. In this case the field of view is actually less than the full 180 degrees, because the sensor size is smaller than the quoted format sizes. With wide angle lenses fitted, the Minoru looks like this:
|
Sign in to add a comment
Nice instructions, thanks! Did you examine if the cameras could be synchronized somehow (external triggering or something)?
I don't think they can be synchronised. The Minoru board is really two webcams plus a USB hub, so it's just like running two independent cameras. Fortunately though the frame rate is sufficiently high that synchronisation isn't much of an issue. Even unsynchronised it would still be possible to use this on a moving robot for obstacle avoidance, provided that it's not moving too rapidly.
Very nice instruction, thanks a lot. A minor problem: The images you mentioned in the instruction do not show up. If the cameras can not be synchronized, in the condition of low frequent fluorescent light, it is very difficult to make it work consistently.
I've actually had it working pretty well under low flourescent light, so it might be a calibration issue. Do you have a screen shot or video?