6#ifndef OPENEV_CONTAINERS_VECTOR_HPP
7#define OPENEV_CONTAINERS_VECTOR_HPP
11#include <opencv2/core/types.hpp>
15constexpr bool USING_VECTOR_HPP =
true;
23class Vector_ :
public std::vector<Event_<T>> {
25 using ResultType = TimeType;
32 [[nodiscard]]
inline ResultType
duration()
const {
33 return std::vector<ev::Event_<T>>::back().t - std::vector<ev::Event_<T>>::front().t;
40 [[nodiscard]]
inline ResultType
rate()
const {
41 return std::vector<ev::Event_<T>>::size() /
duration();
53 return {x, y, t, p > 0.5};
60 [[nodiscard]]
inline cv::Point_<ResultType>
meanPoint()
const {
70 [[nodiscard]]
inline ResultType
meanTime()
const {
78 [[nodiscard]]
inline ResultType
midTime()
const {
79 return 0.5 * (std::vector<ev::Event_<T>>::front().t + std::vector<ev::Event_<T>>::back().t);
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:77
PolarityType p
Definition types.hpp:80
TimeType t
Definition types.hpp:79
This class extends std::vector to implement event vectors. For more information, please refer here.
Definition vector.hpp:23
ResultType midTime() const
Calculate the midpoint time between the oldest and the newest event.
Definition vector.hpp:78
Event_< ResultType > mean() const
Compute the mean of the events.
Definition vector.hpp:48
ResultType rate() const
Compute event rate as the ratio between the number of events and the time difference between the last...
Definition vector.hpp:40
ResultType meanTime() const
Compute the mean time of the events.
Definition vector.hpp:70
cv::Point_< ResultType > meanPoint() const
Compute the mean x,y point of the events.
Definition vector.hpp:60
ResultType duration() const
Time difference between the last and the first event.
Definition vector.hpp:32
Basic event-based vision structures based on OpenCV components.
Vector_< double > Vectord
Definition vector.hpp:85
Vector_< float > Vectorf
Definition vector.hpp:84
Vector_< long > Vectorl
Definition vector.hpp:83
Vectori Vector
Definition vector.hpp:86
Vector_< int > Vectori
Definition vector.hpp:82