OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
ev::EventHistogram_< T, Options, E > Class Template Reference

This class extends ev::EventImage_<T> for event 2D histograms. More...

#include <event-histogram.hpp>

Inheritance diagram for ev::EventHistogram_< T, Options, E >:
ev::EventImage_< T, RepresentationOptions::NONE, int > ev::AbstractRepresentation_< T, Options, int > ev::Stats_< AbstractRepresentation_< T, Options, int > >

Public Member Functions

template<typename... Args>
 EventHistogram_ (Args &&...args)
cv::Mat & render ()
 Render event histogram matrix.
void setOutlierRejection (const double k)
 Saturate the pixels whose count is abnormally high when rendering.
Public Member Functions inherited from ev::EventImage_< T, RepresentationOptions::NONE, int >
 EventImage_ (Args &&...args)
cv::Mat & render ()
Public Member Functions inherited from ev::AbstractRepresentation_< T, Options, int >
std::size_t count () const
 Number of events integrated in the representation.
TimeType firstTimestamp () const
 Timestamp of the oldest event integrated in the representation.
TimeType lastTimestamp () const
 Timestamp of the newest event integrated in the representation.
void clear ()
 Remove all events from the representation.
bool insert (const Event_< int > &e)
 Insert one event in the representation.
void setTimeOffset (const Event_< int > &e)
 Set time offset.
void setValue (const bool polarity, const Type &value)
 Set values for ON and OFF pixels.
void setValues (const Type &positive, const Type &negative, const Type &reset)
 Set values for ON, OFF, and non-activated pixels.
void setColor (const bool polarity, const cv::viz::Color &color)
 Set colors for ON and OFF pixels. For more information, please refer here.
void setColors (const cv::viz::Color &positive, const cv::viz::Color &negative, const cv::viz::Color &reset)
 Set colors for ON, OFF, and non-activated pixels. For more information, please refer here.
void setColormap (const cv::ColormapTypes cm)
 Set colormap for the representation.
Public Member Functions inherited from ev::Stats_< AbstractRepresentation_< T, Options, int > >
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.

Public Attributes

Mat::Counter counter {cv::Mat_<int>(EventImage_<T, Options, E>::size())}

Additional Inherited Members

Public Types inherited from ev::AbstractRepresentation_< T, Options, int >
using Type
Public Types inherited from ev::Stats_< AbstractRepresentation_< T, Options, int > >
using ResultType

Detailed Description

template<typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
class ev::EventHistogram_< T, Options, E >

This class extends ev::EventImage_<T> for event 2D histograms.

Analogously to OpenCV library, the following aliases are defined for convenience:

using EventHistogram1b = EventHistogram_<uchar>;
using EventHistogram3b = EventHistogram_<cv::Vec3b>;
using EventHistogram1s = EventHistogram_<short>;
using EventHistogram3s = EventHistogram_<cv::Vec3s>;
using EventHistogram1w = EventHistogram_<ushort>;
using EventHistogram3w = EventHistogram_<cv::Vec3w>;
using EventHistogram1i = EventHistogram_<int>;
using EventHistogram3i = EventHistogram_<cv::Vec3i>;
using EventHistogram1f = EventHistogram_<float>;
using EventHistogram3f = EventHistogram_<cv::Vec3f>;
using EventHistogram1d = EventHistogram_<double>;
using EventHistogram3d = EventHistogram_<cv::Vec3d>;
EventHistogram1 EventHistogram
Definition event-histogram.hpp:93
EventHistogram_< uchar > EventHistogram1b
Definition event-histogram.hpp:79
EventHistogram1b EventHistogram1
Definition event-histogram.hpp:91
EventHistogram_< cv::Vec3f > EventHistogram3f
Definition event-histogram.hpp:88
EventHistogram_< cv::Vec3b > EventHistogram3b
Definition event-histogram.hpp:80
EventHistogram_< cv::Vec3d > EventHistogram3d
Definition event-histogram.hpp:90
EventHistogram_< float > EventHistogram1f
Definition event-histogram.hpp:87
EventHistogram_< ushort > EventHistogram1w
Definition event-histogram.hpp:83
EventHistogram_< cv::Vec3i > EventHistogram3i
Definition event-histogram.hpp:86
EventHistogram3b EventHistogram3
Definition event-histogram.hpp:92
EventHistogram_< cv::Vec3w > EventHistogram3w
Definition event-histogram.hpp:84
EventHistogram_< double > EventHistogram1d
Definition event-histogram.hpp:89
EventHistogram_< cv::Vec3s > EventHistogram3s
Definition event-histogram.hpp:82
EventHistogram_< int > EventHistogram1i
Definition event-histogram.hpp:85
EventHistogram_< short > EventHistogram1s
Definition event-histogram.hpp:81

Member Function Documentation

◆ render()

template<typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
cv::Mat & ev::EventHistogram_< T, Options, E >::render ( )

Render event histogram matrix.

Event histogram matrix is generated from counter matrix.

◆ setOutlierRejection()

template<typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
void ev::EventHistogram_< T, Options, E >::setOutlierRejection ( const double k)
inline

Saturate the pixels whose count is abnormally high when rendering.

Parameters
kMedian absolute deviations above the median at which a pixel is considered an outlier.
Note
A pixel with count \( C_{i,j} \) saturates when \( |C_{i,j}| > \mathrm{median}(C) + 1.4826 \, k \, \mathrm{MAD}(C) \).

Member Data Documentation

◆ counter

template<typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
Mat::Counter ev::EventHistogram_< T, Options, E >::counter {cv::Mat_<int>(EventImage_<T, Options, E>::size())}

Event counter


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