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
Connect an image-producing function block to the
Image Anyinput.The image will appear in the
Image Displayarea.Click on any point on the displayed image to select it. The selection is shown with markers on the image.
Use the outputs
(Blue, Green, Red)andPointto 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 Imageso 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 SelectorImage ROIthen connect the cropped result to this block.To annotate results or mark sampled positions on a final output image, use
Draw PointorDraw Rectangleafter sampling.If lighting or color makes sampling noisy, try preprocessing with
Blur,Image Threshold, orHSV Filterbefore feeding the image here to improve sampling consistency.To save sampled images or logs, connect this blockβs image output path to
Image LoggerorImage Writefor 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 Resizeif needed).
Last updated
Was this helpful?