OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
efft.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_ALGORITHMS_EFFT_HPP
7#define OPENEV_ALGORITHMS_EFFT_HPP
8
9#include "efft/include/efft.hpp"
10#include "openev/core/types.hpp"
11#include <opencv2/core/mat.hpp>
12#include <opencv2/core/matx.hpp>
13
14namespace ev {
15
16template <unsigned int N>
17class efft : public eFFT<N> {
18public:
19 efft() {
20 eFFT<N>::initialize();
21 }
22
23 template <typename E = int>
24 inline bool update(const Event_<E> &e, const bool state) {
25 return eFFT<N>::update({static_cast<unsigned int>(e.y), static_cast<unsigned int>(e.x), state});
26 }
27
28 template <typename E = int>
29 inline bool insert(const Event_<E> &e) {
30 return eFFT<N>::update({static_cast<unsigned int>(e.y), static_cast<unsigned int>(e.x), true});
31 }
32
33 template <typename E = int>
34 inline bool extract(const Event_<E> &e) {
35 return eFFT<N>::update({static_cast<unsigned int>(e.y), static_cast<unsigned int>(e.x), false});
36 }
37
38 inline cv::Mat mat() {
39 cv::Mat cvMat(N, N, CV_32FC2);
40 Eigen::Map<Eigen::Matrix<std::complex<float>, N, N, Eigen::RowMajor>>(reinterpret_cast<std::complex<float> *>(cvMat.data)) = eFFT<N>::getFFT();
41 return cvMat;
42 }
43};
44
45} // namespace ev
46
47#endif // OPENEV_ALGORITHMS_EFFT_HPP
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition types.hpp:60
Definition efft.hpp:17
Basic event-based vision structures based on OpenCV components.