OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
filtering.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_EVPROC_FILTERING_HPP
7#define OPENEV_EVPROC_FILTERING_HPP
8
10#include "openev/core/types.hpp"
11#include <opencv2/core/types.hpp>
12
13namespace ev {
14[[maybe_unused]] constexpr bool USING_FILTERING_HPP = true;
15
26public:
33 BackgroundActivityFilter(const cv::Size &size, ev::TimeType dt, int radius = 1);
34
35 ~BackgroundActivityFilter() = default;
38 BackgroundActivityFilter &operator=(const BackgroundActivityFilter &) = default;
39 BackgroundActivityFilter &operator=(BackgroundActivityFilter &&) noexcept = default;
40
45 inline void setDt(const ev::TimeType dt) {
46 dt_ = dt;
47 }
48
55 [[nodiscard]] bool operator()(const ev::Event &e);
56
57private:
58 ev::Mat::Time map_;
59 ev::TimeType dt_;
60 int radius_;
61};
62
72public:
78 RefractoryPeriodFilter(const cv::Size &size, ev::TimeType dt);
79
80 ~RefractoryPeriodFilter() = default;
83 RefractoryPeriodFilter &operator=(const RefractoryPeriodFilter &) = default;
84 RefractoryPeriodFilter &operator=(RefractoryPeriodFilter &&) noexcept = default;
85
90 inline void setDt(const ev::TimeType dt) {
91 dt_ = dt;
92 }
93
100 [[nodiscard]] bool operator()(const ev::Event &e);
101
102private:
103 ev::Mat::Time map_;
104 ev::TimeType dt_;
105};
106
107} // namespace ev
108
109#endif // OPENEV_EVPROC_FILTERING_HPP
BackgroundActivityFilter(const cv::Size &size, ev::TimeType dt, int radius=1)
Definition filtering.cpp:10
bool operator()(const ev::Event &e)
Definition filtering.cpp:13
void setDt(const ev::TimeType dt)
Set the time threshold.
Definition filtering.hpp:45
Spatial map storing the timestamp of the most recent event at each pixel.
Definition matrices.hpp:226
RefractoryPeriodFilter(const cv::Size &size, ev::TimeType dt)
Definition filtering.cpp:37
void setDt(const ev::TimeType dt)
Set the inhibition time.
Definition filtering.hpp:90
bool operator()(const ev::Event &e)
Definition filtering.cpp:40
Event-based matrix representations for accumulating events into spatial maps.
Basic event-based vision structures based on OpenCV components.
Eventi Event
Definition types.hpp:262