Example Programs

Showing results for 
Search instead for 
Did you mean: 

Programmatically Create Region of Interest (ROI) and Mask


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



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.




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


  • 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.**

Customer Education Product Support Engineer
National Instruments
Certified LabVIEW Developer

Member aveo

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

Member jhonduar

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

Member Daniel_H1

Creo que necesitar este: http://www.ni.com/download/ni-vision-acquisition-software-2014.02/4584/en/

Customer Education Product Support Engineer
National Instruments
Certified LabVIEW Developer

Member jhonduar

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