This is an example of how to use the PointCloud_<T> class.
#include <opencv2/core/mat.inl.hpp>
#include <opencv2/core/traits.hpp>
#include <random>
int main(int , const char * []) {
int row = 0;
int col = 0;
int direction = 0;
int offset = 0;
double t = 0;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<int> dist(0, 1);
while(offset < 30) {
t += 0.1;
switch(direction) {
case 0:
col++;
if(col >= 50 - offset) {
direction++;
}
break;
case 1:
row++;
if(row >= 50 - offset) {
direction++;
}
break;
case 2:
col--;
if(col <= offset) {
direction++;
offset++;
}
break;
case 3:
row--;
if(row <= offset) {
direction = 0;
}
default:
break;
}
}
return 0;
}
bool insert(const Event_< E > &e)
Insert one event in the representation.
void visualize(const int t, const double time_scale=1.0, const double axis_size=1.0, const double point_size=2.0)
Visualize point cloud.
PointCloud1 PointCloud
Definition point-cloud.hpp:93
Basic event-based vision structures based on OpenCV components.
constexpr bool POSITIVE
Definition types.hpp:27
constexpr bool NEGATIVE
Definition types.hpp:28
Eventi Event
Definition types.hpp:244