Table of Contents

Class Sum

Namespace
Bonsai.Dsp
Assembly
Bonsai.Dsp.dll

Represents an operator that calculates the sum of each channel for all the arrays in the sequence.

[Combinator]
[WorkflowElementCategory(ElementCategory.Transform)]
public class Sum
Inheritance
Sum
Inherited Members

Methods

Process<TArray>(IObservable<TArray>)

Calculates the sum of each channel for all the arrays in an observable sequence.

public IObservable<Scalar> Process<TArray>(IObservable<TArray> source) where TArray : Arr

Parameters

source IObservable<TArray>

A sequence of array values for which to calculate the per-channel sum.

Returns

IObservable<Scalar>

A Scalar tuple containing the sum of each channel for all the arrays in the source sequence.

Type Parameters

TArray

The type of the array-like objects in the source sequence.

Remarks

For multi-channel images using BGR, RGB, or other color formats, the order of values in the Scalar tuple follows the order of channels in the color format, e.g. for a BGR image, the sum for the blue-channel will be stored in Val0, the sum for the green-channel in Val1, etc.

For single-channel arrays such as a grayscale image or a 2D floating point array with signal processing data, the sum will be stored in the first value of the tuple, Val0.