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);
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Base class for all the sensor data consisting of an array of items.
const RawData & GetRawData() const
An array of DVS Events in an image structure HxW
std::vector< std::uint16_t > ToArrayX() const
Get all events' x coordinate for convenience
const auto & GetHeader() const
std::vector< std::vector< std::int64_t > > ToArray() const
Get the array of events in pure vector format
std::vector< std::int64_t > ToArrayT() const
Get all events' timestamp for convenience
std::vector< Color > ToImage() const
Get an event "frame" image for visualization
DVSEventArray(RawData &&data)
std::vector< std::uint16_t > ToArrayY() const
Get all events' y coordinate for convenience
auto GetHeight() const
Get image height in pixels.
std::vector< short > ToArrayPol() const
Get all events' polarity for convenience
auto GetFOVAngle() const
Get horizontal field of view of the image in degrees.
auto GetWidth() const
Get image width in pixels.
Serializes events array generated by DVS camera sensors.
static const DVSHeader & DeserializeHeader(const RawData &data)
This file contains definitions of common data structures used in traffic manager.