Overview
As of LV2015, the only overlays that can be highlighted are rectangles. The NI discussion forums and community has various threads discussing some ways to highlight other ROIs but I could not find any that were successful. I created a VI that uses the IMAQ library to highlight any ROI via a pixel-by-pixel method of "rectangles".
Description
The example (LV2012) highlights any given ROI you draw on a loaded image. If your process is time-sensitive, you will want to keep an eye on the processing time this takes. Depending on the shape you can make the algorithm much more efficient than pixel-by-pixel overlays. For the large red shape, it took 280ms to draw pixel-by-pixel on my laptop... so clearly not efficient on time. However, the program could be modified to highlight larger regions of pixels for significant improvement in execution time. I leave that part up to you!
Steps to Implement or Execute Code
- The IMAQ library is required.
- Run the attached VI
- Press the "Open Image" button to select any image on which you want to draw an ROI. Note that I only tested this with 8-bit greyscale images.
- Draw an ROI on the image using the standard Image Controls Pallete.
- Choose a color and press the "Highlight ROI" button. The algorithm will draw highlighted rectangles pixel-by-pixel for the ROI you specify.
- Press the "Clear Overlays" button to clear all overlays.
- Press the Stop button to stop the VI execution when done.
Requirements
Software
Labview 2012 (or later)
Vision Development Module 2012
Hardware
NA
Additional Images or Video