OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
ev::Mat::Counter Class Reference

Spatial map accumulating signed event counts per pixel. More...

#include <matrices.hpp>

Inheritance diagram for ev::Mat::Counter:
ev::Mat::Mat_< CounterType > ev::Stats_< Mat_< CounterType > >

Public Member Functions

template<typename T>
CounterType insert (const Event_< T > &e)
 Insert an event, incrementing (p=true) or decrementing (p=false) the counter at (e.x, e.y).
template<typename T>
CounterType emplace (const T x, const T y, const bool p)
 Increment or decrement the counter at (x, y) without constructing an Event_.
Public Member Functions inherited from ev::Mat::Mat_< CounterType >
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_< CounterType > >
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.

Friends

std::ostream & operator<< (std::ostream &os, const Counter &counter)

Additional Inherited Members

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

Detailed Description

Spatial map accumulating signed event counts per pixel.

Each positive-polarity event increments the pixel counter by +1; each negative-polarity event decrements it by -1. Counters are stored as CounterType (int16_t by default).

Member Function Documentation

◆ emplace()

template<typename T>
CounterType ev::Mat::Counter::emplace ( const T x,
const T y,
const bool p )
inline

Increment or decrement the counter at (x, y) without constructing an Event_.

Parameters
xSpatial coordinate x
ySpatial coordinate y
ptrue to increment (+1), false to decrement (-1)
Returns
Updated counter value

◆ insert()

template<typename T>
CounterType ev::Mat::Counter::insert ( const Event_< T > & e)
inline

Insert an event, incrementing (p=true) or decrementing (p=false) the counter at (e.x, e.y).

Parameters
eEvent to insert
Returns
Updated counter value

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