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 {
18[[maybe_unused]] constexpr bool USING_EVENT_HISTOGRAM_HPP = true;
19
21template <typename T>
22class Event_;
24
47template <typename T, const RepresentationOptions Options = RepresentationOptions::NONE, typename E = int>
48class EventHistogram_ : public EventImage_<T, Options, E> {
49public:
50 template <typename... Args>
51 explicit EventHistogram_(Args &&...args) : EventImage_<T, Options, E>(std::forward<Args>(args)...) {
53 }
54
55 Mat::Counter counter{cv::Mat_<int>(EventImage_<T, Options, E>::size())};
56
61 cv::Mat &render();
62
68 inline void setOutlierRejection(const double k) {
69 outlierRejectionFactor_ = k;
70 }
71
72private:
73 double outlierRejectionFactor_{0};
74 void clear_() override;
75 void clear_(const cv::Mat &background) override;
76 bool insert_(const Event_<E> &e) override;
77 int peak_{0};
78};
94} // namespace ev
95
97#include "openev/representations/event-histogram.tpp"
99
100#endif // OPENEV_REPRESENTATIONS_EVENT_HISTOGRAM_HPP
Event abstract representation.
This class extends ev::EventImage_<T> for event 2D histograms.
Definition event-histogram.hpp:48
cv::Mat & render()
Render event histogram matrix.
Mat::Counter counter
Definition event-histogram.hpp:55
void setOutlierRejection(const double k)
Saturate the pixels whose count is abnormally high when rendering.
Definition event-histogram.hpp:68
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:86
Spatial map accumulating signed event counts per pixel.
Definition matrices.hpp:336
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
Event images.
Event-based matrix representations for accumulating events into spatial maps.