The example demonstrates how to extract a free shape ROI and mask the image with that ROI.
A ROI or region of interest is used to select the important area of an image for processing. ROIs can be used to greatly reduce image processing time. Recall that LabVIEW currently supports rectangular images; this means that image data must be stored in 2D array/ matrix form. This example describes the most robust means of extracting ROIs.
What happens when users want to use a freeform, non-rectangular, ROI? The most common method of extracting an ROI is creating an ROI descriptor using the rectangle selection tool and the IMAQ Construct ROI(VI), from here the ROI is extracted from the original using IMAQ extract tetragon(VI). Freeform ROI descriptors are also made using IMAQ Construct ROI(VI). In order to extract non rectangular ROIs special steps are taken and are described in this example.
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
Open the attached file
(Optional) Change the path to the preset image in the block diagram (step 1)
Run the VI
Select a ROI in the dialog shown with any of the tools
See the result in the image control
Additional Information or References
Dialog VI that is displayed after the VI is launched
**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.**