Per-Object Averaging Filter

The per-object averging filter calculates averages of pixel-based data for all pixels that belong to the given object.

Category

category_object_processing Object Processing

Node

perobjectaveraging_node

Parameters

(None)

Inputs

Objects: a list of objects as generated from an object detection filter

Input Pixels: the input pixel data that should be averaged

Outputs

Averages: a matrix of averages; the rows correspond to the individual objects, the columns correspond to the channels of the input data that is being averaged

Effect of the Filter

The filter takes two inputs: an object list (typically directly from an object detection filter), and a image-based pixel input. The pixel input must have the same image structure that the image has the objects were initially detected on.

It will average all pixels that belong to the object (it will use the object’s bounding box and mask to determine which) and add an entry in its output for each object containing that average.

During the average all pixels that include NaN will be ignored.

The list of average spectra generated this way may then be further processed via other pixel-based filters.

Illustration with Artificial Data

Take the following input data for the object detector:

_images/perobject_illustration.svg

The detector would generate the following list of objects:

_images/perobject_input_list.png

If the pixel input for the object is given by the following list of spectra:

_images/perobject_input_spectra.png.svg

Then the per-object averaging filter will return the following averages for the list of objects:

_images/perobjectaveraging_output.png

Handling of Training Data

In some cases it might be useful to use classifiers (or other algorithms that require training) on per-object data, such as the averages produced by this filter. But labels are assigned to individual pixels in fluxTrainer; and the spectra for individual objects will not have any group labels assigned to them.

In order to still allow for training of classifiers based on per-object operations, the per-object averaging filter will generate an internal (hidden) data set that has a single entry per group. It will average all pixels for each group that were provided in the second input, and add those averages to the internal (hidden) data set labelled for the corresponding groups.

It is hence possible to use e.g. a Distance Classifier Filter or a Partial Least Squares Regression after a per-object averaging filter.

Note though that there will only be one spectrum per group in the internal data set, so any classifier after this cannot work in a mode that requires multiple spectra per group.

Sequenced Operations (Line Cameras)

The object processing filter also works with line cameras (or in the case of hyperspectral cameras, Push Brooms). The processing framework will automatically keep enough of the input pixel data round in memory that once the line gets processed that causes the object detector to output the object, the pixels that belonged to the object remain accessible to this filter.