SDK Analytics Events

struct Metavision::EventSpatterCluster

Structure representing a cluster of events.

Public Functions

inline const cv::Point2f get_centroid() const

Returns the center of the cluster.

Returns

The center of the cluster

inline const cv::Rect2f get_rect() const

Returns the rectangle defined by the cluster.

Returns

Rectangle defined by the cluster

EventSpatterCluster() = default

Default constructor.

inline EventSpatterCluster(float x, float y, float width, float height, int id, int untracked_times, timestamp ts)

Constructor.

Parameters
  • x – X coordinate of the rectangle defined by the cluster

  • y – Y coordinate of the rectangle defined by the cluster

  • width – Width of the rectangle defined by the cluster

  • height – Height of the rectangle defined by the cluster

  • id – Cluster ID

  • untracked_times – Number of untracked times

  • ts – Timestamp of the detection

inline EventSpatterCluster(float x, float y, float width, float height, timestamp ts)

Constructor.

Parameters
  • x – X coordinate of the rectangle defined by the cluster

  • y – Y coordinate of the rectangle defined by the cluster

  • width – Width of the rectangle defined by the cluster

  • height – Height of the rectangle defined by the cluster

  • ts – Timestamp of the detection

inline void write_event(void *buf, timestamp origin) const

Writes EventSpatterCluster to buffer.

Public Members

float x

x coordinate of the upper left corner of the cluster’s bounding box

float y

y coordinate of the upper left corner of the cluster’s bounding box

float width

Width of the cluster’s bounding box.

float height

Height of the cluster’s bounding box.

int id = -1

Cluster’s ID.

int untracked_times = 0

Number of untracked times.

timestamp t

Timestamp of the detection.

Public Static Functions

static inline EventSpatterCluster read_event(void *buf, const timestamp &delta_ts)

Reads event 2D from buffer.

Returns

Event spatter cluster

static inline size_t get_raw_event_size()

Returns the size of the RawEvent.

Returns

The size of the RawEvent

Friends

inline friend std::ostream &operator<<(std::ostream &output, const EventSpatterCluster &e)

Operator <<.

struct Metavision::EventJet

Struct representing a detected jet event.

Public Functions

EventJet() = default

Default constructor.

inline EventJet(timestamp ts, long count, timestamp previous_jet_dt)

Constructor.

Parameters
  • ts – Timestamp of the beginning of the jet, in us

  • count – Jet number

  • previous_jet_dt – Jet duration, in us

Public Members

long count = {0}

Jet number.

timestamp t = {-1}

Timestamp of the beginning of the jet, in us.

timestamp previous_jet_dt = {-1}

Time since the beginning of the last jet, in us.

A negative value means this time-difference isn’t defined yet because so far there has only been at most one jet

struct Metavision::EventJetAlarm

Struct representing a jet monitoring alarm.

Public Types

enum class AlarmType

Alarm types.

Values:

enumerator JetNotDetected
enumerator JetTooEarly
enumerator TooManyJets

Public Functions

EventJetAlarm() = default

Default constructor.

inline EventJetAlarm(timestamp ts, AlarmType alarm_type)

Constructor.

Parameters
  • ts – Timestamp of the jet, in us

  • alarm_type – Alarm type

Public Members

timestamp t = {-1}

Event timestamp; timestamp at which the event was generated, in us.

timestamp alarm_ts = {-1}

Alarm condition timestamp; timestamp at which the alarm condition occurred, in us.

Note

This is always <= t because of the confirmation delays in the algorithm

std::string info

Detailed information on the alarm.

struct Metavision::EventTrackingData

Structure representing a tracked object that is produced by the TrackingAlgorithm. More precisely, this structure represents the bounding box around the events generated by the tracked object during a given time slice.

Public Functions

EventTrackingData() = default

Default constructor.

EventTrackingData(double x, double y, timestamp t, double width, double height, size_t object_id)

Constructor.

Parameters
  • x – Bounding box’s center’s abscissa coordinate.

  • y – Bounding box’s center’s ordinate coordinate.

  • t – Current track’s timestamp.

  • width – Bounding box’s width.

  • height – Bounding box’s height.

  • object_id – Tracked object’s ID.

EventTrackingData(double x, double y, timestamp t, double width, double height, size_t object_id, size_t event_id)

Constructor.

Parameters
  • x – Bounding box’s center’s abscissa coordinate.

  • y – Bounding box’s center’s ordinate coordinate.

  • t – Current track’s timestamp.

  • width – Bounding box’s width.

  • height – Bounding box’s height.

  • object_id – Tracked object’s ID.

  • event_id – Instance’s ID.

inline bool operator==(const EventTrackingData &ev) const

Comparison operator.

Parameters

ev – The event to compare with the current instance.

Returns

true if the two events are equal.

inline bool operator!=(const EventTrackingData &ev) const

Comparison operator.

Parameters

ev – The event to compare with the current instance.

Returns

true if the two events are different.

inline void write_event(void *buf, timestamp origin) const

Serializes an EventTrackingData in a buffer.

Parameters
  • buf – Pointer to the raw buffer in which the event has to be serialized.

  • origin – Time delta to subtract from the event’s timestamp.

Public Members

unsigned short x

Column position in the sensor at which the event happened.

unsigned short y

Row position in the sensor at which the event happened.

timestamp t

Timestamp at which the event happened (in us)

double y_

Bounding box’s center’s coordinates.

double height_

Bounding box’s dimensions.

size_t object_id_

Tracked object’s ID.

size_t event_id_

Instance’s ID.

Public Static Functions

static inline EventTrackingData read_event(void *buf, const timestamp &delta_ts = 0)

Deserializes an EventTrackingData from a buffer.

Parameters
  • buf – Pointer to the raw buffer from which the event has to be deserialized.

  • delta_ts – Time delta to add to the deserialized event’s timestamp.

Returns

The deserialized event.