WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation


Return the number of blobs which match the specified colour bin (or all colour bins).
This will ask the camera to return the matching blob areas which match the specified colour bin. The colour bin can either by any individual bin or can be the 'magic' value of CAMERA_ALL_BINS to mean ANY camera bin.
The value returned is the number of matching blobs. This can be used along with fetchBlob to iterate through the list of blobs.
Camera. getBlobs(bin)
Where Camera is the name you have given to the device in Project Designer.
The colour bin in the range 0 to number of bins - 1.
The list returned is always sorted into descending rectangle size - so the biggest rectangle is always at the top of the list.
uint8_t blobs = camera.getBlobs( CAMERA_ALL_BINS);
if(blobs == 0){
    // No blobs are visible
    for(uint8_t b = 0; b<blobs; b++){
        // Fetch the blobs - the biggest first
        Blob blob;
        camera.fetchBlob(b, blob);
        // See Cameras/_camera_common.h to see the fields in a CAMERA_BLOB
        // But in summary these include the left, right, top and bottom of
        // the rectangle. The x,y position of the center of the blob relative
        // to the center of the screen. The total size of the blob and the
        // the colour bin.
        cout << "Center=" << blob.xCenter << ',' << blob.yCenter;
        cout << " Size=" << blob.pixels;
See Also



Valid XHTML 1.0 Transitional