OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
event-histogram.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_REPRESENTATIONS_EVENT_HISTOGRAM_HPP
7#define OPENEV_REPRESENTATIONS_EVENT_HISTOGRAM_HPP
8
12#include <opencv2/core/hal/interface.h>
13#include <opencv2/core/mat.hpp>
14#include <opencv2/core/matx.hpp>
15#include <utility>
16
17namespace ev {
19template <typename T>
20class Event_;
22
45template <typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
46class EventHistogram_ : public EventImage_<T, Options, E> {
47public:
48 template <typename... Args>
49 explicit EventHistogram_(Args &&...args) : EventImage_<T, Options, E>(std::forward<Args>(args)...) {
51 }
52
53 Mat::Counter counter{cv::Mat_<int>(EventImage_<T, Options, E>::size())};
54
59 cv::Mat &render();
60
66 inline void setOutlierRejection(const double k) {
67 outlierRejectionFactor_ = k;
68 }
69
70private:
71 double outlierRejectionFactor_{0};
72 void clear_() override;
73 void clear_(const cv::Mat &background) override;
74 bool insert_(const Event_<E> &e) override;
75 int peak_{0};
76};
92} // namespace ev
93
95#include "openev/representations/event-histogram.tpp"
97
98#endif // OPENEV_REPRESENTATIONS_EVENT_HISTOGRAM_HPP
Event abstract representation.
This class extends ev::EventImage_<T> for event 2D histograms.
Definition event-histogram.hpp:46
cv::Mat & render()
Render event histogram matrix.
Mat::Counter counter
Definition event-histogram.hpp:53
void setOutlierRejection(const double k)
Saturate the pixels whose count is abnormally high when rendering.
Definition event-histogram.hpp:66
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:78
Spatial map accumulating signed event counts per pixel.
Definition matrices.hpp:322
EventHistogram1 EventHistogram
Definition event-histogram.hpp:91
EventHistogram_< uchar > EventHistogram1b
Definition event-histogram.hpp:77
EventHistogram1b EventHistogram1
Definition event-histogram.hpp:89
EventHistogram_< cv::Vec3f > EventHistogram3f
Definition event-histogram.hpp:86
EventHistogram_< cv::Vec3b > EventHistogram3b
Definition event-histogram.hpp:78
EventHistogram_< cv::Vec3d > EventHistogram3d
Definition event-histogram.hpp:88
EventHistogram_< float > EventHistogram1f
Definition event-histogram.hpp:85
EventHistogram_< ushort > EventHistogram1w
Definition event-histogram.hpp:81
EventHistogram_< cv::Vec3i > EventHistogram3i
Definition event-histogram.hpp:84
EventHistogram3b EventHistogram3
Definition event-histogram.hpp:90
EventHistogram_< cv::Vec3w > EventHistogram3w
Definition event-histogram.hpp:82
EventHistogram_< double > EventHistogram1d
Definition event-histogram.hpp:87
EventHistogram_< cv::Vec3s > EventHistogram3s
Definition event-histogram.hpp:80
EventHistogram_< int > EventHistogram1i
Definition event-histogram.hpp:83
EventHistogram_< short > EventHistogram1s
Definition event-histogram.hpp:79
Event images.
Event-based matrix representations for accumulating events into spatial maps.