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 <complex>
12
#include <eigen3/Eigen/Core>
13
#include <opencv2/core/hal/interface.h>
14
#include <opencv2/core/mat.hpp>
15
#include <opencv2/core/mat.inl.hpp>
16
#include <opencv2/core/matx.hpp>
17
18
namespace
ev {
19
template
<
typename
T>
20
class
Event_
;
21
22
template
<
unsigned
int
N>
23
class
efft :
public
eFFT<N> {
24
public
:
25
efft() {
26
eFFT<N>::initialize();
27
}
28
29
template
<
typename
E =
int
>
30
inline
bool
update(
const
Event_<E>
&e,
const
bool
state) {
31
return
eFFT<N>::update({
static_cast<
unsigned
int
>
(e.y),
static_cast<
unsigned
int
>
(e.x), state});
32
}
33
34
template
<
typename
E =
int
>
35
inline
bool
insert(
const
Event_<E>
&e) {
36
return
eFFT<N>::update({
static_cast<
unsigned
int
>
(e.y),
static_cast<
unsigned
int
>
(e.x),
true
});
37
}
38
39
template
<
typename
E =
int
>
40
inline
bool
extract(
const
Event_<E>
&e) {
41
return
eFFT<N>::update({
static_cast<
unsigned
int
>
(e.y),
static_cast<
unsigned
int
>
(e.x),
false
});
42
}
43
44
inline
cv::Mat mat() {
45
cv::Mat cvMat(N, N, CV_32FC2);
46
Eigen::Map<Eigen::Matrix<std::complex<float>, N, N, Eigen::RowMajor>>(
reinterpret_cast<
std::complex<float> *
>
(cvMat.data)) = eFFT<N>::getFFT();
47
return
cvMat;
48
}
49
};
50
51
}
// namespace ev
52
53
#endif
// OPENEV_ALGORITHMS_EFFT_HPP
ev::Event_
This class extends cv::Point_<T> for event data. For more information, please refer here.
Definition
types.hpp:62
types.hpp
Basic event-based vision structures based on OpenCV components.
modules
algorithms
include
openev
algorithms
efft.hpp
Generated by
1.13.2