# Blob Detector

This function block detects blob-like features (bright/dark roundish objects) in an image. Use the sliders to tune detection sensitivity and shape filters so the block finds only the blobs you care about.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image Any` Image to analyze for blobs.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Image Any` Visual result image with detected blobs marked.\
`Number of Blobs` Count of detected blobs.\
`Blobs Positions` List of blob center positions (x, y).\
`Blobs Sizes` Sizes (diameter) of detected blobs.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Threshold Range` Minimum and maximum intensity thresholds used to detect candidate blobs.\
`Area Range` Minimum and maximum blob area as a percentage of the image scale.\
`Circularity Range` Allowed circularity range to favor round shapes.\
`Convexity Range` Allowed convexity range to exclude highly concave shapes.\
`Inertia Range` Allowed inertia ratio range to filter elongated vs. round blobs.

## 🎯 Features <a href="#features" id="features"></a>

* Visual feedback: detected blobs are drawn on the output image so you can inspect results immediately.
* Shape filtering: narrow detections using area, circularity, convexity and inertia sliders to reduce false positives.
* Live tuning: slider adjustments take effect on the next evaluation so you can iterate quickly.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Provide an image to `Image Any`.
2. Start with a broad `Threshold Range` and adjust until most blob candidates appear on the output image.
3. Use `Area Range` to remove very small or very large detections relative to your object size.
4. Tune `Circularity Range`, `Convexity Range` and `Inertia Range` to exclude shapes that are not blob-like.
5. Inspect results in the output image and read the numeric outputs for automation or logging.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When run, the block analyzes the input image and returns a marked image plus the number, positions and sizes of detected blobs. Use these outputs downstream for measurement, counting or decision logic.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Preprocess noisy images with `Blur` or `Denoising` to reduce spurious small detections.
* Convert complex scenes to a clearer foreground with `Image Threshold` or `HSV Filter` before feeding this block.
* If you only need to analyze a region, crop first using `Image ROI Select` to speed up detection and avoid background blobs.
* For large images, try `Image Resizer` to lower resolution and increase processing speed while keeping meaningful blob sizes.
* Visualize or save results using `Show Image` and `Image Logger` when tuning or to keep records.
* Combine with drawing blocks such as `Draw Detections` to overlay counts or rectangular markers on the image for operator displays.

(hint: use these related blocks to improve robustness and speed: `Blur`, `Image Threshold`, `Image ROI Select`, `Image Resizer`, `Denoising`, `Show Image`, `Image Logger`, `Draw Detections`)

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No blobs detected: widen the `Threshold Range` and increase the `Area Range`; check the input image contrast.
* Too many small false blobs: increase the minimum in `Area Range` or apply `Blur` / `Image Threshold` to remove noise.
* Detecting elongated or irregular shapes: tighten `Circularity Range` and/or adjust `Inertia Range` to favor round blobs.
* Inconsistent detections across frames: use consistent lighting, or apply preprocessing (`Auto Contrast` / `Denoising`) to stabilize input images.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/detections-shapes/detectors/blob-detector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
