revisited 01/02/2002

The Robolab-designers introduced some very powerful multimedia-features in version 2.5. Among others those programs permit strong LEGO-camera functions and picture-analysis.

Robolab is not too friendly in help-files or tutorials, this is the only serious weakness of the software, especially for advanced users. So you have to experience by your own and learn by doing, trying. But this is not too bad for finally getting familiar with LABVIEW on which Robolab is based. So here some useful tips.

The following Labview/Robolab-program allows you to count various white blops on a grey background. The camera is initialized, then a grey snapshot is taken, transformed to a binary picture, corrected a bit, inverted. Now the picture is analyzed for blops and shown in an intensity graph. Finally the camera is closed. The program may run continously if the button is activated.

If the blops-analyzer is replaced by the Complex-blops icon, you'll get much more information about the blops. This information is available in the IMAQ, which is one sub-vi of the complex blops program-part. It is located in the ..\Robolab\Engine\Utilities\Vision\Analysis.llb library. Download

As you can see the information is stored in a 1-dimensional array of a cluster where you find the total area, perimeter, position and s.o. of the single particle. In the example we have the fields 0 .. 6 for 7 particles. This information can easily be extracted by unbundling the clusters. (This will be documented later)

Conclusion : It is quite easily possible to use the LEGO camera (or any other compatible Logitech-camera) for global positioning. 

Here the test of some geometric forms :

Note that the picture has been filtered differently and the graph has been transposed.

triangle, Projection x = 85 = 278-193 ...

square, biggest area


Here now a more serious program for analyzing pictures and sending data to the RCX.

You need the

The program checks every second if the area of the blops are within the given ranges. If true, for test reasons the respective y-position is sent to the RCX.

NOTE: There are two special vis which are implemented :



The program can be tested with :

We tested on different computers and we found out that for slow computers the image-processing thread will blocate the serial communication. So we changed the program a bit to

Here we need some new sub.vis :, and We added some dummy cluster-terminals, so that the icons can be propperly arranged in the multimedia-series. As Labview is data-flow controlled, we don't need sequence-structures anymore.

There seems to be a problem when loading or, Robolab doesn't scan the library ..\Robolab\Engine\Multimedia.llb while searching for Display You have to do this manually. Better is to change the location to a library which is scanned, for example ..\Robolab\Engine\Vi.lib\VideoII.llb.

With we may now send the blop-identification-number, the posx and posy of all the blops whose areas are in the user-defined area-ranges. The refresh-time may be set. 

NOTE that and should ONLY be exited by disabling the Continuous-Button !!! Any hardbrake will not close the camera-port correctly.

Test the with

The results will be stored in variables 1..3 (4?). The Serial Port sends the characters from the serial port buffer, which is not the actual but the previous information. So, after sending and receiving data from one blop (example : ID 1 pos-x 147, pos-y 233), the RCX-containers will have the following values :

Red container (var 0) 4
Blue (1) 232 (from previous package)
Yellow (2) 1  ID
User 3 (3) 147  pos-x
User 4 (4) 233  pos-y


RetourMain Page