Overview
This example gives an in-depth explanation of Vision ROI descriptors. It details how each ROI type descriptors are represented and defined in LabVIEW.
Description
The example has a tab for each ROI type: Point, Line, Rectangle, Oval, Polygon, Freehand, Annulus, Broken Line, Freehand, Rotated Rectangle and Draw.
Each tab shows the descriptor for the ROI. The descriptor contains the following things:
- The Global Rectangle defines the minimum rectangle required to contain all of the contours in the ROI.
- The contours array contains all the individual shapes that define the ROI. You can have multiple contours (or shapes) per ROI descriptor.
- ID refers to whether the contour is the external or internal edge of an ROI. If the contour is external, all of the area inside is considered part of the ROI. If the contour is internal, then all of the area outside of the ROI defined lines is considered part of the ROI.
- Type is the shape of the contour.
- Coordinates array contains the coordinates that define the contour. Depending on the type, the coordinates will be represented by different sets of points. Each tab describes what those coordinates represent for each type.
The last tab allows you to draw an ROI and look at how the descriptor is changed. Use that tab to understand the difference between Freehand ROI, Broken Line ROI, Freehand Line ROI and Polygon ROI. Those four ROI types differ more in how they are drawn on the IMAQ Image Control rather than how they are defined in the ROI descriptor.
Hardware and Software Requirements
LabVIEW Full Development System 2014 or later
Vision Development Module 2014 or later
Steps to Implement or Execute Code
- Run VI
- Go through the tabs to learn about the different ROI types. Observe the Descriptor Cluster for the ROI that is already drawn in each IMAQ Image Control.
- Go to the last tab “Draw ROI” and draw a ROI on the IMAQ Image Control. Single left click creates a point and double left click completes the ROI.
T. Le
Vision Product Support Engineer
National Instruments