OpenEV
Extending OpenCV to event-based vision
 
Loading...
Searching...
No Matches
vector.hpp
1
6#ifndef OPENEV_CONTAINERS_VECTOR_HPP
7#define OPENEV_CONTAINERS_VECTOR_HPP
8
10#include <opencv2/core/types.hpp>
11#include <vector>
12
13namespace ev {
19template <typename T>
20class Vector_ : public std::vector<Event_<T>> {
21 using std::vector<Event_<T>>::vector;
22
23public:
28 [[nodiscard]] inline double duration() const;
29
34 [[nodiscard]] inline double rate() const;
35
40 [[nodiscard]] Eventd mean() const;
41
46 [[nodiscard]] inline cv::Point2d meanPoint() const;
47
52 [[nodiscard]] inline double meanTime() const;
53
58 [[nodiscard]] inline double midTime() const;
59};
60using Vectori = Vector_<int>;
61using Vectorl = Vector_<long>;
62using Vectorf = Vector_<float>;
63using Vectord = Vector_<double>;
64using Vector = Vectori;
65} // namespace ev
66
67#endif // OPENEV_CONTAINERS_VECTOR_HPP
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:55
This class extends std::vector to implement event vectors. For more information, please refer here.
Definition vector.hpp:20
double midTime() const
Calculate the midpoint time between the oldest and the newest event.
Definition vector.cpp:41
double rate() const
Compute event rate as the ratio between the number of events and the time difference between the last...
Definition vector.cpp:15
double duration() const
Time difference between the last and the first event.
Definition vector.cpp:10
double meanTime() const
Compute the mean time of the events.
Definition vector.cpp:36
Eventd mean() const
Compute the mean of the events.
Definition vector.cpp:20
cv::Point2d meanPoint() const
Compute the mean x,y point of the events.
Definition vector.cpp:29
Basic event-based vision structures based on OpenCV components.
Event_< double > Eventd
Definition types.hpp:207