A Lego-robot with camera controlled by Matlab

disclaimer

Software for the camera

A few words about how I mounted the camera can be found from the 'Constructing the robot' -page.

As mentioned earlier, I used the camera that comes with Lego Mindstorms Vision Command. The program that came with the camera didn't want to install on my Windows 2000, but that caused no problems. The camera is actually a repacked Logitech QuickCam Web, and my Windows found the drivers automatically when I plugged in the camera to the USB port. If the drivers can't be automatically found they can be downloaded from Logitech's website.

Getting the images to Matlab

To grab the images to Matlab i use a tool called Vision For Matlab by Farzad Pezeshkpour. The binaries needed by the Matlab programs are included in my distribution file. The source codes of VFM can be found at http://www.isr.ist.utl.pt/~alex/Resources/vfm/ .

A few notes about VFM

  • When I installed another webcam to my computer (for taking the photos used in this documentation, BTW), I had some serious trouble with the VFM. It nicely asked upon startup which camera to use, but when doing the realtime image analysis it really often just stopped updating the picture returned to Matlab. Uninstalling the software and drivers for both cameras and reinstalling only the Vision Commander -camera helped.
  • VFM has a 'preview' feature (accessible through the menus) that updates picture in the VFM-window in realtime. When this option is on, the VFM will spend quite a lot of time updating the picture, so when doing the realtime analysis it's best to have the preview-mode off. (On my computer almost half of the time during the realtime-analysis is spent on waiting for new picture from VFM, so when it slows down to about one third of it's original speed the analysis will be much slower.)