Table Of Contents

ROI to Mask (G Dataflow)

Last Modified: June 25, 2019

Transforms a region of interest into a mask.

connector_pane_image
datatype_icon

image model

Template for the destination image where the mask is placed.

This can be any image type that NI Vision supports. Image takes the characteristics of Image Model (size and location of ROI) when Image Model is connected. However, the connection of Image Model is optional. When no Image Model is connected, the size of the image mask generated is limited to the bounding rectangle of the ROI Descriptor.gtype, which reduces the amount of memory used. The offset of the image mask generated is set to reflect the real position of the ROI.

datatype_icon

image in

Reference to the destination image in which the mask is created.

datatype_icon

ROI descriptor

Descriptor that defines the region of interest.

datatype_icon

global rectangle

Minimum rectangle required to contain all of the contours in the ROI.

datatype_icon

Contours

Each of the individual shapes that define the ROI.

datatype_icon

ID

Contour that is the external or internal edge of an ROI.

If the contour is external, all of the area inside it is considered part of the ROI. This node draws the contours in the order that they are listed in the ROI Descriptor.gtype.

Internal contours do not become part of the mask. You can use internal contours to create non-mask regions inside external contours.

datatype_icon

Type

Shape type of the contour.

datatype_icon

Coordinates

Coordinates that define the contour.

datatype_icon

fill value

Pixel value of the mask.

All pixels inside the region of interest take this value.

Default: 255

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

background value

Pixel value of the background.

Default: 0

datatype_icon

image out

Reference to image in.

datatype_icon

coordinates out of image?

ROI data found outside the space associated with the Image Model.

True ROI data is found outside space associated with Image Model
False ROI data is found inside space associated with Image Model
datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Using This Node

You can use this VI in two ways. The simplest technique is to connect the input Image Model. In this case you can use the source image, in which the image ROI was drawn, as a template for the final destination image by connecting it to Image Model. The output image (Image Out) automatically acquires the size of the image and location of the ROI as found in the original source image.

However, you do not have to connect an Image Model. In this case, the ROI requires an offset that is determined automatically from the upper-left corner of the bounding rectangle described by the ROI. These offset values are automatically set to the image mask.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics