Activity MetricΒΆ

The Activity Metric is defined by the following formula:

\[A_{i} = \sum_{x=1}^{n} \sum_{y=1}^{m} \left[ \frac{2 * |P_{i} \left(x,y \right) - P_{i-1} \left(x,y \right)|} {P_{i} \left(x,y \right) + P_{i-1} \left(x,y \right)} > T \right] \bigcap \left[ |P_{i} \left(x,y \right) - P_{i-1} \left(x,y \right)| > D\right]\]

where \(P_{i} \left(x,y \right)\) is the pixel value at location \(\left(x,y \right)\) in frame \(i\) and \(P_{i-1} \left(x,y \right)\) is the pixel value at the same location (x,y) for the prior frame. The difference between the two pixel values is normalized by the average of the two pixel values and compared to a threshold \(T\). If the normalized difference is greater than \(T\) then the pixel is considered active. The difference between the two pixel values is also compared to \(D\), the difference threshold. If the difference between the two pixel values is greater than \(D\) than the pixel is considered active. A pixel must exceed both the \(T\) and the \(D\) thresholds to be counted as active. Activity for frame \(i\) is a count of all the active pixels between frame \(i\) and frame \(i-1\).

With this formula the Activity Metric for the first frame is always 0. The activity metric is calculated for each series of frames in the dataset array individually, resulting in an array of values of shape (number of frames, number of images in array).