Demonstrates how to build an image mask and use it to mask out a portion of an image.
The example allows the user to draw a region of interest and then mask out all pixels that aren't in that region. The masked image is displayed in a separate window and window events are used to ensure the same position and zoom factor between the two images.
LabVIEW 2014 or compatible
Vision Development Module 2014 or compatible
1. Download the attached VI, or in LabVIEW, go to Help >> Find Examples >> Toolkits and Modules >> Vision >> Image Management
2. Run the VI.
Front Panel:
There are also similar examples for CVI and Visual Basic. These examples are attached and can also be found in the following locations:
CVI:
National Instruments\MeasurementStudio\CVI\samples\2. Functions\Image Management
- Mask.prj
Visual Basic:
National Instruments\vision\examples\MSVB\2. Functions\Image Management
- Mask.vbp
Alyssa
Applications Engineer
National Instruments
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.