ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Example Code

Image Mask

代码和文档

添加附件

Overview

 Demonstrates how to build an image mask and use it to mask out a portion of an image.

 

Description

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.

 

Hardware and Software Requirements

LabVIEW 2014 or compatible

Vision Development Module 2014 or compatible

 

Steps to Implement or Execute Code

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:Image Mask.PNG

 

Additional Information or References

 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

NI社区“代码范例交流区”(Example Code Exchange)中的代码范例已获得MIT许可

贡献者