Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Zoom and Mask Image using Regions of Interest(ROIs)

by Member Jamie_J on ‎11-09-2012 10:55 AM

Hello Developers,

The following VI allows you to take an image and zoom into a specific Region of Interest (ROI). From here you can specify a further ROI on top of this template and mask the image as shown below. Finally, the mask itself is displayed which could be used elsewhere with other images.

To enable usability One Button Dialog functions have been used in conjunction with Case Structures which allow the user 3 seconds to mark each ROI.

The IMAQ Extract Function has been used to create the 1st 'Zoomed in' template. Following this a combination of the IMAQ ROI to Mask 2 and IMAQ Mask functions generate and apply the user-defined Mask.

This VI would have uses in many Vision applications possibly where the user wants to specify an area of the image to color black and ignore in a Matching application. This is shown in the below image where the pigeon's number is masked.


Instructions to run the code:

1. Enter the file path of the image you would like to mask.

2. Run the VI and select a Region of Interest when prompted. This selection will be used to fill the Template Image Display so you can work on a much smaller section of the original.

3. Select a Region of Interest on the Template Image. This is the area you wish to mask.

4. The mask will be generated and displayed in the Mask Image Display.

5. Finally, the Template image will be masked over the previous ROI selection.