OpenEV
Extending OpenCV to event-based vision
 
Loading...
Searching...
No Matches
example-point-cloud.cpp

This is an example of how to use the PointCloud_<T> class.

int main(int argc, const char *argv[]) {
ev::PointCloud pointcloud;
int row = 0;
int col = 0;
int direction = 0;
int offset = 0;
double t = 0;
while(offset < 30) {
t += 0.1;
pointcloud.insert(ev::Event(col, row, t, (rand() % 2) ? ev::POSITIVE : ev::NEGATIVE));
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;
}
}
pointcloud.visualize(0, 0.4);
return 0;
}
bool insert(const Event_< E > &e)
Insert one event in the representation.
Include all the OpenEV modules.
PointCloud1 PointCloud
Definition point-cloud.hpp:91
constexpr bool POSITIVE
Definition types.hpp:25
constexpr bool NEGATIVE
Definition types.hpp:26
Eventi Event
Definition types.hpp:242