Cross-hairs and camera image overlay

We are working on the dashboard for LabView and the camera image on it. We are trying to figure out an easy way to overlay an image on the camera section, like a cross-hair. We would like to know the easiest way to overlay a cross-hair on the the image section and to also know if there’s a way to add buttons to the dashboard to toggle between different overlaying images (like switch between different kinds of cross-hairs depending on which button is pressed).

I would suggest creating your own dashboard project from the Getting Started window. The diagram gets the image and clears any annotations and sends it to the display. Just after clearing the annotation is where you can add your own lines, circles, boxes, text, etc. The icons are in the vision/Utilities/Overlay palette. To select between different ones, use a case statement or subVI and a button or other selector.

Greg McKaskle

I am trying to do the exact same thing. Please see attached image of my labview code. I put a couple input boxes on the dashboard front panel so that the cross hair could be adjusted while the program runs.

Should this do what I want? I don’t have a cRio to test it on, but when I just run the dashboard program my camera image is just a white screen (I was thinking that I’d at least see the yellow line). What kind of coordinates would place a line across the center of the screen?

Thanks!

Pat Levy





While it is certainly possible to embed a line into the actual camera data, and the center would be n/2, where n=number of pixels, it is infinitely easier to create a new dashboard program in the Getting Started Window, and in the front panel for it, create a line with the decorations palette. Place the line over the camera indicator, and change the camera’s IP to match the one on your robot.

To make the custom dashboard function as a normal one, build the dashboard, tothe FRC Dashboard folder, probably in C:/Program Files/FRC Dashboard, and overwrite the previous dashboard

The attached code looks like it will draw one line.

As for whether to do it this way with an annotation or as an overlay. If it is dynamic, like putting a rectangle or circle over some element in the image, then it must be programmed by overlays/annotations. If it is just to indicate the center of the image, it can be done the other way, but the overlay is a bit more efficient since you avoid objects overlapping each other. But as you say, the cosmetic is less programming - an icon and a few wires less.

Greg McKaskle