DetectBlobs

The DetectBlobs function performs a form of blob analysis known as "connectivity analysis" on a Region of Interest (ROI). During "connectivity analysis", the pixels within the ROI are divided into two categories, Blob or Background. During this process, the pixels are examined to determine whether or not they are connected to their neighboring pixels. For a more in-depth description, see Blob.

Once the image is processed, it is now segmented into Blob and Background pixel values. The Blobs found in the ROI are identified based upon physical characteristics and assigned values, such as the location in the image (row and column coordinates), area, perimeter, spread, and elongation. The data from the extracted blobs is stored and reported in a Blobs data structure.

This function is the first step in blob analysis, and both FindBlobs and SortBlobs ultimately use Cell References to the data structure of the DetectBlobs function, either directly or through Auditing.

See the Blobs Vision Data Access functions for details on the result table.

DetectBlobs Example

The DetectBlobs function is used to identify and locate blobs of connected pixels, which can be comprised of various shapes and sizes. This example illustrates how the information returned in the DetectBlobs data structure result table relates to the found blobs, and how that information can be used to later sort and filter the blobs based upon their characteristics.

For this example, the following image helps illustrate the meaning of the values that are returned in the result table of the DetectBlobs function:

A DetectBlobs function is inserted into a blank cell in the spreadsheet. Based upon the shapes, the parameters of the DetectBlobs property sheet are configured as follows:

  • Image: The default setting was used for this example, but this parameter can reference any Image data structure, such as an Image data structure produced by a Filter function, which processes the image to remove excess image noise before inspecting it for blobs.
  • Fixture: The default setting was used because the image is stationary and is not rotated or moved. However, when using the DetectBlobs function on images that undergo movement, it is advisable to assign the image region to a Fixture.
  • Region: The image region was maximized to include all of the shapes in the analysis. By clicking on the Region parameter and then pressing the Maximize Region button on the property sheet's toolbar, the region will automatically be stretched to cover the entire image.
  • Number to Sort: The Number to Sort was set to six. This parameter could have also been set to 0, and the tool would have automatically extracted all blobs that meet the color and size settings specified in the Color Blob/Color Background and Area Limit: Min/Area Limit: Max parameters.
  • Threshold: The default setting was used, which automatically calculates the greyscale Threshold value. In this image, the greyscale value differences are very pronounced and it is very clear which pixels are the dark pixels and which are the light. In applications where there is a more subtle gradation and the automatic threshold setting does not separate the values very well, using Histogram functions, such as the HistHead or HistTail functions, to determine the greyscale intensities in different regions of the image can be very helpful.
  • Fill Holes: The default setting was used, enabling the contribution of the holes found in the blobs, thus decreasing the overall area of those blob shapes with holes in them. Had the Fill Holes checkbox been checked, holes within blobs are reported and the area within the holes would have been added, thus increasing the area of the blobs with holes.
  • Boundary Blobs: The default setting was used, which includes any blobs that intersect the image region's boundary. With this setting, if the image had been moved to the left, and the biggest circle and the smallest square shape intersected the left-most boundary of the image region, the parts of those shapes that still fell within the region's boundary would be extracted as blobs. If the checkbox had been unchecked, though, those blobs would not have been processed.
  • Area Limit: Min/Max: The default settings were used. These settings filter through the blobs in the region during the extraction phase, evaluating the blobs based upon the minimum and maximum area limit settings to determine whether or not the area of the blob allows it to be classified as a blob.
  • Show: The default setting was used, which only allows the result graphics to be displayed when the cell containing the Blobs data structure is selected, as in the example below.

After configuring the DetectBlobs property sheet, a Blobs data structure and result data table are produced.

The values returned in the result table can be used to filter and sort the blobs, using the FindBlobs and SortBlobs functions. For example, a FindBlobs function could be inserted into the spreadsheet and reference the DetectBlobs function. The FindBlobs function would then be used to filter the blobs based upon their Spread. Then a SortBlobs function could be inserted into the spreadsheet and it could reference the recently created FindBlobs function to sort the list of blobs based upon their X, Y position.