Background Exclusion Filter

Calculates a mask that indicates which pixels are background and which pixels are foreground.

Category

category_mask_selection Mask and Selection

Node

backgroundmaskingcv_node

Parameters

Reference: What reference should be used for the background:

  • Group average: the background reference is provided by the average of all applicable groups

  • Scene average: the first lines of an image are assumed to be part of the background and are used as the reference

Distance Method: what method to use to calculate the distance between a pixel and the background (This provides a subset of the distance methods provided by the Distance classifier filter.)

Distance Threshold: what threshold (in terms of a similarity level ranging from 0 to 1, see the Distance classifier filter for details) should be used distinguish between background and foreground.

Initial Rows to Average: (only relevant when using the Scene Average reference) the number of lines to assume to be background at the top of the image

Average Column-wise: (only relevant when using Scene Average reference) whether to have a global reference for the background, or whether to keep a column-wise reference (i.e. an individual reference for each x position)

Applicable (group-specific): which groups should be considered part of the background when using a Group average reference.

Inputs

Input: the input to use to determine the mask

Outputs

Mask: the resulting mask

Effect of the Filter

The filter will calculate the similarity of each pixel in the input to a given reference. If the pixel is similar enough, the pixel will be considered to be part of the background. If the pixel is not similar enough, it will be considered part of the foreground.

The reference can be given in two ways: either it is given by the average spectra of a set of groups (that are applicable to this filter), or it can be given by the average of the first set of lines of the input image.

In the case where the group averages are used, each pixel will be compared to the average spectra of all applicable groups individually, and if it is similar enough to at least one applicable group, it will be considered to be a background pixel. (Note that the special background label is not considered by this filter, the groups here have to be actual groups created by the user.)

In the case where a scene average is used, the first lines of a given image will be averaged and assumed to be the background. If the filter is applied to sequenced data (from a line camera, e.g. a HSI PushBroom camera) line by line, it is important that the first lines that are being processed are in fact lines that contain only the background that should be excluded.

In the scene average mode it is also possible to perform the average column-wise, i.e. use a different reference for each x position of the image. This mode can be useful for line cameras with inhomogeneities in the x direction.

The resulting mask may be used as input for a Mask-based Object Detector Filter or a Mask-based Selection Filter.

This filter is an alternative to the Background Masking Filter to cope with slightly different sets of circumstances for excluding a given background.

See also