Example Code

Mask Examples

Code and Documents

Attachment

The following examples ship with Vision:

LabVIEW:
National Instruments\LabVIEW\examples\2. Functions\Image Management
- Mask Example.vi

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

The following examples illustrate additional functionality with masks.

The first 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 seperate window and window events are used to ensure the same position and zoom factor between the two images.

The second example is similar to the first. It allows the user to extract an arbitrary region and masks out all pixels not in the region.

The third example uses CVI callbacks with window events to create a mask and perform some analysis on only the pixels inside the mask.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors