OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
time-surface.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_REPRESENTATIONS_TIME_SURFACE_HPP
7#define OPENEV_REPRESENTATIONS_TIME_SURFACE_HPP
8
12#include <opencv2/core/hal/interface.h>
13#include <opencv2/core/matx.hpp>
14#include <opencv2/core/utils/logger.hpp>
15#include <utility>
16
17namespace cv {
19class Mat;
21} // namespace cv
22
23namespace ev {
25template <typename T>
26class Event_;
28
51enum class Kernel { NONE,
52 LINEAR,
53 EXPONENTIAL };
54template <typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
55class TimeSurface_ : public EventImage_<T, Options, E> {
56public:
57 template <typename... Args>
58 explicit TimeSurface_(Args &&...args) : EventImage_<T, Options, E>(std::forward<Args>(args)...) {
60 }
61
62 Mat::Time time{this->size()};
63 Mat::Polarity polarity{this->size()};
64
72 cv::Mat &render(const Kernel kernel = Kernel::NONE, const double tau = 0);
73
74private:
75 void clear_() override;
76 void clear_(const cv::Mat &background) override;
77 bool insert_(const Event_<E> &e) override;
78};
94} // namespace ev
95
97#include "openev/representations/time-surface.tpp"
99
100#endif // OPENEV_REPRESENTATIONS_TIME_SURFACE_HPP
Event abstract representation.
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:78
Spatial map storing the polarity of the most recent event at each pixel.
Definition matrices.hpp:274
Spatial map storing the timestamp of the most recent event at each pixel.
Definition matrices.hpp:226
Definition time-surface.hpp:55
cv::Mat & render(const Kernel kernel=Kernel::NONE, const double tau=0)
Render timesurface matrix.
Mat::Time time
Definition time-surface.hpp:62
Mat::Polarity polarity
Definition time-surface.hpp:63
Event images.
Event-based matrix representations for accumulating events into spatial maps.
TimeSurface_< int > TimeSurface1i
Definition time-surface.hpp:85
TimeSurface_< float > TimeSurface1f
Definition time-surface.hpp:87
TimeSurface_< cv::Vec3w > TimeSurface3w
Definition time-surface.hpp:84
TimeSurface_< cv::Vec3f > TimeSurface3f
Definition time-surface.hpp:88
TimeSurface_< cv::Vec3s > TimeSurface3s
Definition time-surface.hpp:82
TimeSurface1b TimeSurface1
Definition time-surface.hpp:91
TimeSurface_< ushort > TimeSurface1w
Definition time-surface.hpp:83
TimeSurface_< cv::Vec3i > TimeSurface3i
Definition time-surface.hpp:86
TimeSurface3b TimeSurface3
Definition time-surface.hpp:92
TimeSurface_< uchar > TimeSurface1b
Definition time-surface.hpp:79
Kernel
This class extends ev::EventImage_<T> for time surfaces.
Definition time-surface.hpp:51
TimeSurface_< cv::Vec3d > TimeSurface3d
Definition time-surface.hpp:90
TimeSurface_< double > TimeSurface1d
Definition time-surface.hpp:89
TimeSurface_< cv::Vec3b > TimeSurface3b
Definition time-surface.hpp:80
TimeSurface_< short > TimeSurface1s
Definition time-surface.hpp:81
TimeSurface1 TimeSurface
Definition time-surface.hpp:93