# Blob

In machine vision terminology, any two-dimensional, variably shaped and similarly shaded group of connected pixels can be referred to as a "blob A blob is a group of pixels on the image that form a distinct pattern, typically used to represent objects, features, or areas of interest in object detection and segmentation tasks.." The process of extracting these blobs from an image, finding them in a region of interest and sorting them based on specific criteria is called blob analysis.

## What is Blob Analysis?

The In-Sight Blob Tool performs a type of blob analysis that is referred to as "connectivity analysis", which is accomplished by using the DetectBlobs function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications.. When the DetectBlobs function is inserted into the spreadsheet and its parameters configured, the function begins performing the analysis by first segmenting the ROI.

During this process, the pixels in the ROI are divided into two categories, Blob and Background, based upon the greyscale threshold value. This threshold value separates the pixels so that those pixels below the threshold value are categorized as Black, and those values over the threshold are categorized as White.

Note: The threshold can be determined by using the Threshold parameter automatic setting of the DetectBlobs function, manual configuration through trial and error, or as a reference to calculated results of the Histogram A histogram is a graphical representation of the distribution of pixel intensity values. A histogram refers to an array of pixels - how many and their individual greyscale values - within a region of interest (ROI). function.

During this process, the pixels are examined to determine whether or not they are connected to their neighboring pixels. A Blob pixel is connected to neighboring pixels if the Blob pixel touches another pixel of similar value either to the side, above, below, or diagonal to it. A Background pixel is connected to neighboring pixels if the Background pixel touches another pixel of similar value either to the side, above, or below it.

The figure demonstrates how the In-Sight Blob Tool analyzes an image. In this example, a greyscale threshold value of 150 is used to segment the image into Blob and Background pixels. All pixels with greyscale values greater than or equal to 150 are categorized as White, or Background, pixels. All pixels with values less than 150 are categorized as Black, or Blob, pixels.

Once the blob has been extracted from the image, DetectBlobs automatically creates a Blobs data structure and a result table that contains the data about the extracted blob. The information returned can be utilized by the FindBlobs and SortBlobs functions to filter and sort through other found blobs, based upon their physical characteristics and location, respectively.

Note: Both FindBlobs and SortBlobs must reference a Blob data structure. This data structure can be created by a DetectBlobs, FindBlobs, or SortBlobs function.

The FindBlobs function analyzes the blobs within a ROI and determines whether or not the found blobs match the specified requirements. The blobs that meet the requirements are returned and scored in terms of how closely they match the requirements, in descending order.

The SortBlobs function analyzes the blobs within a ROI and determines where the blob is located in relation to a fixture A fixture is a coordinate location on the image that keeps the tool in the place determined by the fixture.. This helps determine the position of a blob relative to another blob. A single DetectBlobs function can be used to find many blobs in a ROI at once.

## When is Blob Analysis Used?

Use the In-Sight Blob Tools when the following conditions apply:

- The image is of a two-dimensional object.
- The image provides high contrast between light and dark pixels.

Note: The In-Sight Blob Tool only analyzes greyscale images. All color images are automatically converted to a greyscale value.

## Why is Blob Analysis Used?

When these conditions are met, blob analysis can be extremely useful in the following applications:

- Coarse gauging applications, such as measuring diameters or dimensions of squares to determine the width of a part in a particular orientation.
- First-pass positioning applications, where the Blob Tools are used to quickly locate and place a rough fixture for another tool.
- Presence/absence applications where the Blob Tools are used to determine whether or not a blob is present or absent in the image.
- Counting applications, where the Blob Tools can be set up to count and sort blobs based upon characteristics such as their area or perimeter.

## How to Perform Blob Analysis

With the In-Sight Blob Tools, the process of blob analysis can be broken down into three steps:

1. Examine the image and determine whether or not the image and its conditions meet the requirements for blob analysis.

2. Insert a DetectBlobs function into the spreadsheet and set the parameters accordingly to locate and identify the blobs in the image.

3. Insert a FindBlobs or SortBlobs function into the spreadsheet to filter the list of found blobs based on physical characteristics or the location of the blob, respectively.