6#ifndef OPENEV_CONTAINERS_VECTOR_HPP
7#define OPENEV_CONTAINERS_VECTOR_HPP
11#include <opencv2/core/types.hpp>
21class Vector_ :
public std::vector<Event_<T>> {
30 return std::vector<ev::Event_<T>>::back().t - std::vector<ev::Event_<T>>::front().t;
37 [[nodiscard]]
inline double rate()
const {
38 return std::vector<ev::Event_<T>>::size() /
duration();
50 return {x, y, t, p > 0.5};
57 [[nodiscard]]
inline cv::Point2d
meanPoint()
const {
75 [[nodiscard]]
inline double midTime()
const {
76 return 0.5 * (std::vector<ev::Event_<T>>::front().t + std::vector<ev::Event_<T>>::back().t);
79using Vectori = Vector_<int>;
80using Vectorl = Vector_<long>;
81using Vectorf = Vector_<float>;
82using Vectord = Vector_<double>;
83using Vector = Vectori;
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:56
bool p
Definition types.hpp:59
double t
Definition types.hpp:58
This class extends std::vector to implement event vectors. For more information, please refer here.
Definition vector.hpp:21
double midTime() const
Calculate the midpoint time between the oldest and the newest event.
Definition vector.hpp:75
double rate() const
Compute event rate as the ratio between the number of events and the time difference between the last...
Definition vector.hpp:37
double duration() const
Time difference between the last and the first event.
Definition vector.hpp:29
double meanTime() const
Compute the mean time of the events.
Definition vector.hpp:67
Eventd mean() const
Compute the mean of the events.
Definition vector.hpp:45
cv::Point2d meanPoint() const
Compute the mean x,y point of the events.
Definition vector.hpp:57
Basic event-based vision structures based on OpenCV components.
Event_< double > Eventd
Definition types.hpp:230