# Corner Detector

This function block detects corner patterns in an image and highlights them for visual inspection. It is useful for feature extraction, alignment checks, and preparation for shape or tracking tasks.

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

`Image Any` This is the image to analyze. Accepts grayscale or color images.

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

`Detected Corners` An image with detected corners drawn for quick visual feedback.

`Number of Corners` Total count of detected corner points.

`Locations` List of corner coordinates (multiple points) for downstream processing.

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

`Detector Type` Choose the corner detection method (options include HARRIS CORNER and SHI-THOMAS CORNER).

`Threshold` Adjusts sensitivity for how many corners are detected. Higher values reduce detections; lower values increase detections.

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

* Visual markers drawn on the input image to show each detected corner.
* Option to switch between two widely used corner detection algorithms.
* Returns both visual output and structured data (count and coordinates) for further processing.

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

When provided an image through the input socket, the block analyzes local intensity patterns to locate corner points. It marks each detected corner on a copy of the input image and outputs the annotated image, the number of corners found, and the list of their coordinates. You can switch detection method and tune the `Threshold` to control sensitivity.

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

1. Connect an image source to the `Image Any` input.
2. Select the desired `Detector Type`.
3. Adjust `Threshold` until the number of detected corners matches your expectation.
4. Use the `Detected Corners` output to preview results and `Locations` output for further automation.

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

* Preprocess noisy images with `Blur` or `Denoising` to remove spurious corners from texture noise.
* Improve contrast and visibility of features with `Contrast Optimization` or `Adjust Colors` before detection.
* Limit the search area using `Image ROI Select` or `Image ROI` so only the region of interest is processed.
* If the image is very large and detection is slow, use `Image Resize` to downscale before running this block.
* Visualize results larger or inspect details using the `Show Image` block.
* Combine corner outputs with `Find Contour` or `Feature Detector` when you need higher-level object localization or matching.
* Store or freeze a good frame for reference with `Image Memory` or save examples via `Image Logger`.

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

* If too many corners are detected, raise the `Threshold` or apply smoothing with `Blur`.
* If too few or no corners are detected, lower the `Threshold` or increase contrast with `Contrast Optimization`.
* If detected points appear outside the area of interest, crop the input with `Image ROI Select` before feeding this block.
* For inconsistent results across lighting conditions, try `Adjust Colors` or disable automatic camera adjustments upstream (use camera advanced settings if available).


---

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