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)

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

πŸ“€ Outputs (sockets)

(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

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

  • 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

  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

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

  • 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

  • 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).

Last updated

Was this helpful?