FIFO event container that retains only events within a trailing time window.
More...
#include <sliding_window.hpp>
|
| | SlidingWindow_ (const TimeType window=0) |
| | Construct a sliding window with the given temporal span.
|
| TimeType | window () const |
| | Return the current time window length.
|
| void | setWindow (const TimeType window) |
| | Set a new time window length and immediately discard events outside the new window.
|
| void | push (const Event_< T > &event) |
| | Push an event to the back and discard front events older than the window.
|
| void | push (Event_< T > &&event) |
| | Push an event (move) to the back and discard front events older than the window.
|
|
template<typename... Args> |
| void | emplace (Args &&...args) |
| | Construct an event in-place at the back and discard front events older than the window.
|
| 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.
|
| Event_< ResultType > | mean () const |
| | Compute the mean of the events.
|
| cv::Point_< ResultType > | meanPoint () const |
| | Compute the mean x,y point of 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.
|
template<typename T>
class ev::SlidingWindow_< T >
FIFO event container that retains only events within a trailing time window.
Events are pushed to the back; after each insertion, front events older than \( t_{newest} - window \) are automatically discarded. Inherits all Deque_ statistics (duration, rate, mean, etc.) computed over the retained events.
Analogously to OpenCV library, the following aliases are defined for convenience:
SlidingWindow_(const TimeType window=0)
Construct a sliding window with the given temporal span.
Definition sliding_window.hpp:40
SlidingWindowi SlidingWindow
Definition sliding_window.hpp:104
SlidingWindow_< float > SlidingWindowf
Definition sliding_window.hpp:102
SlidingWindow_< long > SlidingWindowl
Definition sliding_window.hpp:101
SlidingWindow_< double > SlidingWindowd
Definition sliding_window.hpp:103
SlidingWindow_< int > SlidingWindowi
Definition sliding_window.hpp:100
◆ SlidingWindow_()
Construct a sliding window with the given temporal span.
- Parameters
-
| window | Time window length in the same units as Event_::t (default 0, retains all events). |
◆ push() [1/2]
Push an event to the back and discard front events older than the window.
- Parameters
-
◆ push() [2/2]
Push an event (move) to the back and discard front events older than the window.
- Parameters
-
◆ setWindow()
Set a new time window length and immediately discard events outside the new window.
- Parameters
-
◆ window()
Return the current time window length.
- Returns
- Window length
The documentation for this class was generated from the following file: