# Detect blobs

Detects blobs in an image using 4- or 8-connectivity. The tool can work without a separate tresholding step. If it is given a gray-level or color image, it automatically thresholds it while scanning the image.

## Inputs

image
Input image.
minimumBlobSize
The minimum area of a detected blob in world units. Blobs smaller than this are discarded. The limit is accurate at the center of the image. Blobs which are near an edge of the image and are smaller than the limit may pass the filter due to perspective distortion. If this is not acceptable, correct the perspective first for example by passing the image through virtual view.
maximumBlobSize
The maximum area of a detected blob in world units. Blobs larger than this are discarded. The limit is accurate at the center of the image. Blobs which are near an edge of the image and are larger than the limit may pass the filter due to perspective distortion. If this is not acceptable, correct the perspective first for example by passing the image through virtual view.
threshold
Threshold for automatic binarization. If invert is false, every pixel with a gray level higher than or equal to threshold will be considered part of a blob. If invert is true, every pixel with a gray level below threshold will be considered part of a blob.
hysteresis
Hysteresis for automatic binarization. If hysteresis is set to a non-zero value, foreground objects are allowed to contain pixels whose gray level does not meet the thresholding rule. If the gray level of a pixel is within hysteresis gray levels from the threshold and connected to a blob that has at least one pixel that meets the threshold rule, it will be considered part of the blob.
invert
Inverts automatic binarization result if set to true.
thresholdType
If set to StaticThreshold, applies parameters threshold and hysteresis to binarization. If set to DynamicThreshold, the algorithm identifies the regions which look like a blob and applies an individually selected binarization threshold for each region. Notice that blurring the image with Gaussian filter with a 3...9 pixel kernel may improve dynamic blob detection due to reduced noise.
sensitivity
Sensitivity of the dynamic thresholding mode. The smaller the sensitivity, the more distinct the edges of a region must be in order to qualify as a blob. The range is [0...1].
algorithm
Chooses the labeling algorithm (4- or 8-connectivity).

## Outputs

labels
Labeled image in which the objects are marked with increasing ordinal numbers 1,2,...,N.
blobCount
The number of distinct objects in the input image.
Enumerator
Connect4

Pixels are regarded as neighbors if their horizontal or vertical edges touch each other.

Connect8

Pixels are regarded as neighbors if they share edges or corners. That is, diagonally connected pixels are also considered neighbors.

Enumerator
StaticThreshold

Use the given threshold in binarization.

DynamicThreshold

Use dynamic threshold in binarization.