> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/detections-shapes/roi-processing/get-pixel-mouse.md).

# Get Pixel Mouse

This function block lets you interactively pick a pixel from an image by clicking on the displayed image. It shows the clicked position on the image and outputs the pixel color (or grayscale value) and the pixel coordinates.

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

`Image Any` The image to display and pick a pixel from.

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

`(Blue, Green, Red)` The sampled pixel value. For color images this is a BGR tuple, for grayscale images a single-channel value is returned.

`Point` The pixel coordinates in image space as `(x, y)`.

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

`Image Display` Interactive image area where you can click to select a pixel.

`Click to Select` Click on the displayed image to pick a point. The selected point is marked visually (concentric markers) so you can confirm the selection.

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

* Visual feedback: The selected pixel is highlighted directly on the image so you immediately see where the sample was taken.
* Color and position outputs: Provides both the pixel color/value and its image coordinates for downstream processing.
* Works with color and grayscale images: Returns a BGR tuple for color images and a single value for grayscale images.
* Remembers last selection: The last clicked position is preserved so the display and outputs remain consistent until you pick a new point.

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

1. Connect an image-producing function block to the `Image Any` input.
2. The image will appear in the `Image Display` area.
3. Click on any point on the displayed image to select it. The selection is shown with markers on the image.
4. Use the outputs `(Blue, Green, Red)` and `Point` to feed other function blocks or record the sampled value.

## 📊 What happens when it runs <a href="#evaluation" id="evaluation"></a>

When the block runs it displays the latest image from its input. If you have clicked on the image, it updates the display with a visual marker and provides the sampled pixel value and coordinate through the outputs.

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

* To preview or zoom images before clicking, combine with `Show Image` so you can open the image in a larger viewer and inspect details before sampling.
* If you only need to sample within a specific area, crop the image first using `Image ROI Select` or `Image ROI` then connect the cropped result to this block.
* To annotate results or mark sampled positions on a final output image, use `Draw Point` or `Draw Rectangle` after sampling.
* If lighting or color makes sampling noisy, try preprocessing with `Blur`, `Image Threshold`, or `HSV Filter` before feeding the image here to improve sampling consistency.
* To save sampled images or logs, connect this block’s image output path to `Image Logger` or `Image Write` for archival or reporting.

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

* No marker appears after clicking: Make sure an image is connected and visible in the `Image Display`. If no image is present, click will have no effect.
* Unexpected pixel values: Verify whether the input image is color or grayscale—color images return a BGR tuple, grayscale returns a single value.
* Coordinates out of range: Click positions are constrained to the displayed image area. If you see unexpected coordinates, ensure the displayed image matches the actual image resolution (use `Image Resize` if needed).
