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

Matrix of event data. On top of cv::Mat_, it can account for the events it receives through updateStats(). More...

#include <matrices.hpp>

Inheritance diagram for ev::Mat::Mat_< T >:
ev::Stats_< Mat_< T > > ev::Mat::Binary_< uchar > ev::Mat::Ternary_< signed char >

Public Member Functions

void updateStats (const Event &e)
 Account for an event in the statistics reported by count() and duration().
std::size_t count () const
 Number of events accounted for by updateStats().
TimeType firstTimestamp () const
 Timestamp of the first event accounted for by updateStats().
TimeType lastTimestamp () const
 Timestamp of the last event accounted for by updateStats().
void resetStats ()
 Reset statistics.
void clear ()
 Reset all pixels.
Public Member Functions inherited from ev::Stats_< Mat_< T > >
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.

Additional Inherited Members

Public Types inherited from ev::Stats_< Mat_< T > >
using ResultType

Detailed Description

template<typename T>
class ev::Mat::Mat_< T >

Matrix of event data. On top of cv::Mat_, it can account for the events it receives through updateStats().

Note
Accounting is opt-in: insert() and emplace() never call updateStats(), so a matrix that does not use the statistics pays nothing for them.

Member Function Documentation

◆ count()

template<typename T>
std::size_t ev::Mat::Mat_< T >::count ( ) const
inlinenodiscard

Number of events accounted for by updateStats().

Returns
Event count

◆ firstTimestamp()

template<typename T>
TimeType ev::Mat::Mat_< T >::firstTimestamp ( ) const
inlinenodiscard

Timestamp of the first event accounted for by updateStats().

Returns
Timestamp

◆ lastTimestamp()

template<typename T>
TimeType ev::Mat::Mat_< T >::lastTimestamp ( ) const
inlinenodiscard

Timestamp of the last event accounted for by updateStats().

Returns
Timestamp

◆ updateStats()

template<typename T>
void ev::Mat::Mat_< T >::updateStats ( const Event & e)
inline

Account for an event in the statistics reported by count() and duration().

Parameters
eEvent to account for

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