Flexible Masks

ROIs vs flexible masks

ROIs and masks restrict processing to part of an image:

ROI Main Properties apply to all Open eVision functions. Using Regions of Interest accelerates processing by reducing the number of pixels. Open eVision supports hierarchically nested rectangular ROIs.
Flexible Masks are recommended to process disconnected ROIs or non-rectangular shapes. They are supported by some EasyObject and EasyImage library functions.

Flexible Masks

A flexible mask is a BW8 image with the same height and width as the source image. It contains shapes of areas that must be processed and ignored areas (that will not be considered during processing):

All pixels of the flexible mask having a value of 0 define the ignored areas.
All pixels of the flexible mask having any other value than 0 define the areas to be processed.

Source image

Associated mask

Processed masked image

A flexible mask can be generated by any application that outputs BW8 images and by some EasyObject and EasyImage functions.

Flexible Masks in EasyImage

Code Snippets

Source image (left) and mask variable (right)

Flexible Masks in EasyObject

A flexible mask can be generated by any application that outputs BW8 images or uses the Open eVision image processing functions.

EasyObject can use flexible masks to restrict blob analysis to complex or disconnected shaped regions of the image.

If an object of interest has the same gray level as other regions of the image, you can define "keep" and "ignore" areas using flexible masks and Encode functions.

A flexible mask is a BW8 image with the same height and width as the source image.

A pixel value of 0 in the flexible mask masks the corresponding source image pixel so it doesn't appear in the encoded image.
Any other pixel value in the flexible mask causes the pixel to be encoded.