# Harris Corner Filter

This function block detects corner points in images and visualizes them. It is useful for finding feature points for inspection, alignment checks, and shape analysis.

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

* `Image Any` Input image. Accepts grayscale or color images.

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

* `Image Any` Annotated image with detected corners marked.
* `Corner Size` Number of detected corners (numeric).
* `Corner Positions` List of corner coordinates (multiple points).

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

* `Pixel Threshold` Slider to set the minimum corner response needed to consider a pixel as a corner. Higher values reduce detections.
* `Block Size` Slider controlling the local neighborhood used when evaluating corner strength. Larger values look at wider neighborhoods.
* `Aperture Size` Slider that adjusts the sampling aperture used for derivative estimation. Useful to tune detection for small or large features.
* `Harris Free Parameter` Slider to fine-tune the sensitivity of the corner response calculation (expressed as a scaled slider value).

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

* Visual output with detected corners overlaid for quick verification.
* Returns both the count and exact positions of detected corners for downstream processing.
* Works with both color and grayscale images; color inputs are handled automatically.
* Adjustable parameters let you trade off sensitivity vs. robustness to noise.

## ⚙️ How it runs <a href="#running-mechanism" id="running-mechanism"></a>

When active, the block inspects the supplied image, evaluates local corner strength across the image, and marks locations that exceed the chosen threshold. The annotated image, the number of detected corners, and their coordinates are provided as outputs so you can visualize results and feed coordinates into other blocks.

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

1. Feed an image into `Image Any`.
2. Adjust `Pixel Threshold` to control how many points are reported. Start with a mid value and move up to reduce detections or down to increase them.
3. Tune `Block Size` and `Aperture Size` to match the expected feature scale in your image (small features → smaller values; large features → larger values).
4. Use `Harris Free Parameter` for fine sensitivity adjustments.
5. Use the annotated `Image Any` output to confirm detections visually.

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

* Preprocessing: Clean up noise before detecting corners by using `Blur` or `Denoising` to reduce false positives.
* Binary conversion: If your features are high-contrast, try `Image Threshold` first to simplify the image.
* Focus area: Use `Image ROI Select` or `Get ROI` to analyze only a specific region and avoid irrelevant corners.
* Post-filtering: Use `Find Contour` or `Approximate Contour` to group or simplify detected points into shapes, or use `Rectangles in Rectangle` to filter corners inside/outside a region.
* Visualization: Preview and inspect results with `Show Image`. For overlaying markers elsewhere, use `Draw Point` or `Draw Rectangle` with the `Corner Positions` output.

(hint: combining this block with `Blur`, `Image Threshold`, `Image ROI Select`, `Find Contour`, and `Show Image` often gives fast, reliable workflows for inspection and measurement tasks.)

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

* No corners detected
  * Lower `Pixel Threshold` or reduce `Block Size`.
  * Ensure the input has sufficient contrast; consider `Image Threshold` or `Contrast Optimization`.
* Too many false corners
  * Increase `Pixel Threshold` or increase `Block Size`.
  * Smooth image with `Blur` or `Denoising` before detection.
* Detections clustered or noisy
  * Use `Find Contour` / `Approximate Contour` to consolidate nearby points into a meaningful shape or to filter by area.

If results look unexpected, preview the annotated `Image Any` output with `Show Image` to guide parameter tuning.


---

# 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/harris-corner-filter.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.
