OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
ev::Stats_< Derived > Class Template Reference

This is an auxiliary class. This class cannot be instanced. More...

#include <stats.hpp>

Inheritance diagram for ev::Stats_< Derived >:
ev::Array_< int, N > ev::Array_< long, N > ev::Array_< float, N > ev::Array_< double, N > ev::CircularBuffer_< int > ev::CircularBuffer_< long > ev::CircularBuffer_< float > ev::CircularBuffer_< double > ev::Deque_< int > ev::Deque_< long > ev::Deque_< float > ev::Deque_< double > ev::StatsContainer_< int > ev::StatsContainer_< long > ev::StatsContainer_< float > ev::StatsContainer_< double > ev::Vector_< int > ev::Vector_< long > ev::Vector_< float > ev::Vector_< double >

Public Types

using ResultType = TimeType

Public Member Functions

ResultType duration () const
 Time difference between the last and the first event.
ResultType rate () const
 Compute event rate as the ratio between the number of events and the time difference between the last and the first event.
ResultType density (const cv::Size size) const
 Compute event density as the ratio between the number of events and the number of pixels.
std::size_t activePixels () const
 Count the pixels with at least one event.
ResultType fillRatio (const cv::Size size) const
 Compute fill ratio as the fraction of pixels with at least one event.
ResultType polarityRatio (const PolarityType p) const
 Compute polarity ratio as the fraction of events with the given polarity.
Event_< ResultType > mean () const
 Compute the mean of the events.
cv::Point_< ResultType > meanPoint () const
 Compute the mean x,y point of the events.
cv::Matx< ResultType, 2, 2 > covariance () const
 Compute the covariance of the x,y coordinates of the events around meanPoint().
cv::Rect boundingBox () const
 Compute the smallest rectangle of pixels containing the events.
ResultType meanTime () const
 Compute the mean time of the events.
ResultType midTime () const
 Calculate the midpoint time between the oldest and the newest event.
std::size_t peak () const
 Find the largest number of events on a single pixel.
ResultType entropy () const
 Compute the Shannon entropy of the spatial distribution of the events.

Detailed Description

template<typename Derived>
class ev::Stats_< Derived >

This is an auxiliary class. This class cannot be instanced.

Note
Each statistic uses the getters of its ingredients when the class offers them.

Member Function Documentation

◆ activePixels()

template<typename Derived>
std::size_t ev::Stats_< Derived >::activePixels ( ) const
inlinenodiscard

Count the pixels with at least one event.

Returns
Number of active pixels

◆ boundingBox()

template<typename Derived>
cv::Rect ev::Stats_< Derived >::boundingBox ( ) const
inlinenodiscard

Compute the smallest rectangle of pixels containing the events.

Returns
Bounding box in pixels

◆ covariance()

template<typename Derived>
cv::Matx< ResultType, 2, 2 > ev::Stats_< Derived >::covariance ( ) const
inlinenodiscard

Compute the covariance of the x,y coordinates of the events around meanPoint().

Returns
Covariance matrix, with the variances of x and y in the diagonal

◆ density()

template<typename Derived>
ResultType ev::Stats_< Derived >::density ( const cv::Size size) const
inlinenodiscard

Compute event density as the ratio between the number of events and the number of pixels.

Parameters
sizeSize in pixels
Returns
Events per square pixel

◆ duration()

template<typename Derived>
ResultType ev::Stats_< Derived >::duration ( ) const
inlinenodiscard

Time difference between the last and the first event.

Returns
Time difference

◆ entropy()

template<typename Derived>
ResultType ev::Stats_< Derived >::entropy ( ) const
inlinenodiscard

Compute the Shannon entropy of the spatial distribution of the events.

Returns
Entropy in bits
Note
\( H = -\sum_i p_i \log_2 p_i \), where \( p_i \) is the fraction of events falling on the i-th pixel.

◆ fillRatio()

template<typename Derived>
ResultType ev::Stats_< Derived >::fillRatio ( const cv::Size size) const
inlinenodiscard

Compute fill ratio as the fraction of pixels with at least one event.

Parameters
sizeSize in pixels
Returns
Fraction of active pixels, between 0 and 1

◆ mean()

template<typename Derived>
Event_< ResultType > ev::Stats_< Derived >::mean ( ) const
inlinenodiscard

Compute the mean of the events.

Returns
An Eventd object containing the mean values of x, y, t, and p attributes.

◆ meanPoint()

template<typename Derived>
cv::Point_< ResultType > ev::Stats_< Derived >::meanPoint ( ) const
inlinenodiscard

Compute the mean x,y point of the events.

Returns
Mean point

◆ meanTime()

template<typename Derived>
ResultType ev::Stats_< Derived >::meanTime ( ) const
inlinenodiscard

Compute the mean time of the events.

Returns
Mean time

◆ midTime()

template<typename Derived>
ResultType ev::Stats_< Derived >::midTime ( ) const
inlinenodiscard

Calculate the midpoint time between the oldest and the newest event.

Returns
Midpoint time

◆ peak()

template<typename Derived>
std::size_t ev::Stats_< Derived >::peak ( ) const
inlinenodiscard

Find the largest number of events on a single pixel.

Returns
Peak count

◆ polarityRatio()

template<typename Derived>
ResultType ev::Stats_< Derived >::polarityRatio ( const PolarityType p) const
inlinenodiscard

Compute polarity ratio as the fraction of events with the given polarity.

Parameters
pPolarity, POSITIVE or NEGATIVE
Returns
Fraction of events with that polarity, between 0 and 1

◆ rate()

template<typename Derived>
ResultType ev::Stats_< Derived >::rate ( ) const
inlinenodiscard

Compute event rate as the ratio between the number of events and the time difference between the last and the first event.

Returns
Event rate

The documentation for this class was generated from the following file: