Example Code

Programmatically Create Region of Interest (ROI) and Mask

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to create a polygon Region of Interest (ROI) programmatically.

 

Description

The example shows how to programmatically create an image that is not necessarily rectangle-shaped.

By default, images are always rectangle-shaped. To work around this one can create a mask from a Region of Interest (ROI) that is applied onto the image to apply non-rectangle image shapes.

The example provides to possibility to define any ROI type programmatically that is later used to mask the image to the desired shape.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • Vision Development Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI
  3. Select the type of ROI with the tab control
  4. Configure the settings for the respective ROI type

 

Additional Information or References

Programmatically Create ROI - Front Panel.png

 

Programmatically Create ROI - Block Diagram.png

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

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

Comments
aveo
Member
Member
on

Amazing program. This program made my job so easy. Thank You Daniel.

jhonduar
Member
Member
on

Empezando Estoy pana estafa labview cuando abro tu programa la parte de imaq roit o mask esos iconos me aparecen en blanco q debo hacer

Daniel_H1
Member
Member
on
jhonduar
Member
Member
on

yo tengo instalado ni imaq 2012 porqte tengo labview 2012 tu crees q pueda instalar el 2014 para q me aparezcan esos iconos?