59 for (
const auto &event : *
this) {
60 size_t index = (
GetWidth() *
event.y) + event.x;
61 if (event.pol ==
true) {
73 std::vector<std::vector<std::int64_t>>
ToArray()
const {
74 std::vector<std::vector<std::int64_t>> array;
75 for (
const auto &event : *
this) {
76 array.push_back({
static_cast<std::int64_t
>(
event.x), static_cast<std::int64_t>(event.y),
static_cast<std::int64_t
>(
event.t), (2*static_cast<std::int64_t>(event.pol)) - 1});
83 std::vector<std::uint16_t> array;
84 for (
const auto &event : *
this) {
85 array.push_back(event.x);
92 std::vector<std::uint16_t> array;
93 for (
const auto &event : *
this) {
94 array.push_back(event.y);
101 std::vector<std::int64_t> array;
102 for (
const auto &event : *
this) {
103 array.push_back(event.t);
110 std::vector<short> array;
111 for (
const auto &event : *
this) {
112 array.push_back(2*static_cast<short>(event.pol) - 1);
const RawData & GetRawData() const
std::vector< std::uint16_t > ToArrayX() const
Get all events' x coordinate for convenience.
An array of DVS Events in an image structure HxW.
std::vector< std::uint16_t > ToArrayY() const
Get all events' y coordinate for convenience.
std::vector< std::vector< std::int64_t > > ToArray() const
Get the array of events in pure vector format.
This file contains definitions of common data structures used in traffic manager. ...
const auto & GetHeader() const
std::vector< short > ToArrayPol() const
Get all events' polarity for convenience.
static const DVSHeader & DeserializeHeader(const RawData &data)
std::vector< std::int64_t > ToArrayT() const
Get all events' timestamp for convenience.
DVSEventArray(RawData &&data)
Base class for all the sensor data consisting of an array of items.
auto GetFOVAngle() const
Get horizontal field of view of the image in degrees.
std::vector< Color > ToImage() const
Get an event "frame" image for visualization.
auto GetHeight() const
Get image height in pixels.
auto GetWidth() const
Get image width in pixels.
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Serializes events array generated by DVS camera sensors.