# Find Object

This function block helps you locate a smaller template image inside a larger image using selectable matching methods and an adjustable sensitivity slider. It provides visual feedback and detailed location outputs to help with inspection, counting, and further processing.

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

This block accepts the following input sockets:

* `Main Image` Accepts the image where the object search will be performed.
* `Object Image` Accepts the template image (single or list) of the object to find.

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

This block provides the following output sockets:

* `Image Any` Visual result where detected matches can be highlighted.
* `Object Positions` Coordinates of detected object centers (multiple).
* `Object Count` Number of detected objects.
* `Rectangle Coordinates` Bounding rectangles for each detected object (multiple).

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

* `Method` Choose the template matching algorithm to use from a list of available methods.
* `Match Threshold %` Adjust the slider to control how strict the matching should be. Higher values reduce false positives but may miss faint matches.
* `Result` Displays the detected object count for quick feedback.

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

* Visual overlay of detections on the input image for fast verification.
* Multiple output sockets that provide both visual and numeric detection results for downstream processing.
* Works with a single template or a list of templates to find the best available match.

## 📝 How to Use <a href="#usage" id="usage"></a>

1. Provide a source image into the `Main Image` input.
2. Provide a template or list of templates into the `Object Image` input.
3. Select a `Method` that fits your scene and template characteristics.
4. Tune the `Match Threshold %` slider until detection precision is acceptable.
5. Inspect results using the visual output and numerical sockets.

## ⚙️ What Happens When It Runs <a href="#evaluation" id="evaluation"></a>

When executed, the block searches the provided `Main Image` for regions that match the provided `Object Image` based on the selected method and threshold. It returns a visualization, the center positions of detections, their count, and bounding rectangles.

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

* To reduce false matches from noisy images, run the image through `Blur` or `Denoising` before this block.
* If templates and main image sizes differ, use `Image Resize` to standardize sizes for more reliable matching.
* To focus search only on a specific area, crop the image first using `Image ROI Select` and feed the cropped image into this block.
* After detection, use `Rectangles in Rectangle` to filter out detections outside a region of interest.
* Visualize and inspect detections with the `Show Image` block to confirm results interactively.
* Save interesting frames or failures using `Image Logger` or `Image Write` for audit and tuning.
* For complex scenes or many object classes consider pairing with `Object Detection` or `Object Detection - Custom` blocks when template matching becomes unreliable.

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

* If no objects are found, try lowering the `Match Threshold %` or improving template contrast with preprocessing like `Contrast Optimization` or `Adjust Colors`.
* If many false positives appear, increase the `Match Threshold %` and consider filtering the image with `HSV Filter` or `Image Threshold` to emphasize the object.
* If results vary across images, ensure templates are consistent with expected appearance (scale, rotation, illumination) or use multiple templates via the `Object Image` input list.


---

# 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/find-object.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.
