# Match Anything (ELOFTR)

This function block performs keypoint matching between two images to find corresponding points and visualize matches. Use it when you need to compare two views of the same scene, verify alignment, or track correspondences between image pairs.

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

`Image A` The first image to match (can be color or grayscale).

`Image B` The second image to match (can be color or grayscale).

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

`Visualization` Annotated image that shows the two inputs side-by-side with matched keypoints and optional connecting lines.

`Keypoints A` List of matched keypoints in `Image A` (coordinates).

`Keypoints B` List of matched keypoints in `Image B` (coordinates).

`Scores` Matching confidence scores for each matched pair.

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

`Show Matches` Toggle that enables or disables drawing lines between matched keypoints on the visualization.

`Threshold` Slider to set the minimum matching confidence (higher values keep only stronger matches).

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

* Matches keypoints between two images and returns matched point coordinates and confidence scores.
* Optional visualization that places the two images side-by-side and marks matched points (and lines if `Show Matches` is enabled).
* Works with color or grayscale inputs.
* Adjustable confidence threshold to filter weaker matches.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

When the block runs it accepts two image inputs and computes corresponding keypoints between them. The block filters matches by the configured `Threshold` and, if requested, prepares a visualization image that shows the matched keypoints and (optionally) connecting lines. The matched coordinates and scores are provided through the corresponding outputs.

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

1. Provide two related images to `Image A` and `Image B` (for example, two views of the same scene).
2. Adjust `Threshold` to control how strict matching should be.
3. Toggle `Show Matches` to turn on/off lines between matched points in the visualization.
4. Use the `Visualization` output to inspect matches and the `Keypoints A`, `Keypoints B` and `Scores` outputs for downstream processing.

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

* If input images have very different sizes, normalize them first using `Image Resize` to improve matching stability.
* To focus matching on a region of interest, crop images with `Image ROI` or `Image ROI Select` before feeding them into this block.
* Visualize results quickly by connecting the `Visualization` output to `Show Image`.
* Combine with `Feature Detector` when you want to compare classical feature detections with model-based keypoint matches.
* If you later need to draw detection boxes or overlays based on matches, use `Draw Detections` or `Draw Point` with the keypoint coordinates.

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

* No matches or very few matches: lower the `Threshold` slightly, ensure the input images contain overlapping content, or try resizing/preprocessing.
* Many low-confidence matches: increase the `Threshold` to filter out weak correspondences.
* Visualization not appearing: ensure the `Visualization` output is connected to a viewer block like `Show Image`.
* Images with little texture or repetitive patterns may produce ambiguous matches—try focusing on a more distinctive ROI or improving image quality with `Contrast Optimization`.


---

# 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/ai-blocks/match-anything-eloftr.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.
