SDK Core Events
-
struct
Metavision
::
EventBbox
Class representing a spatio-temporal bounding-box event.
The timestamp of the event (i.e. member variable ‘t’) is by convention the detection timestamp. Convention about the spatial position is that points with u in [x, x + w[ and v in [y, y + h[ are inside the bounding-box and everything else is outside.
Public Functions
-
inline
EventBbox
() Default constructor.
-
inline
EventBbox
(timestamp time, float x, float y, float w, float h, unsigned int class_id, unsigned int track_id, float class_confidence) Constructs a Event Bounding box.
- Parameters
time – Timestamp of last detection
x – Column index
y – Row index
w – Bounding box’s width
h – Bounding box’s height
class_id – Class identifier
track_id – Track identification number
class_confidence – Detection confidence
-
inline void
write_event
(void *buf, timestamp origin) const Writes EventBbox in buffer.
- Parameters
buf – Memory in which the bounding box will be serialized
origin – Reference timestamp cut away from the bounding box timestamp
-
inline float
get_x
() const Gets x position of the bounding box.
- Returns
X position of the bounding box
-
inline float
get_y
() const Gets y position of the bounding box.
- Returns
Y position of the bounding box
-
inline float
get_width
() const Gets bounding box’s width.
- Returns
Width of the bounding box
-
inline float
get_height
() const Gets bounding box’s height.
- Returns
Height of the bounding box
-
inline unsigned int
get_class_id
() const Gets bounding box’s class id.
- Returns
bounding box’s class id
-
inline float
intersection_area
(const EventBbox &bbox2) const Computes the area recovered by both boxes.
- Parameters
bbox2 – Box to be compared with
- Returns
The intersection area between current bbox and bbox 2 (in pixel * pixel)
-
inline float
intersection_area_over_union
(const EventBbox &bbox2) const Computes the proportion of box overlap.
- Parameters
bbox2 – Box to be compared with
- Returns
Percentage of overlap
-
inline void
write_csv_line
(std::ostream &output, char sep = ' ') const Serialize a bounding box in csv format.
- Parameters
output – Stream in which the csv of the bounding box will be written
sep – Character inserted between fields
Public Members
-
float
x
X coordinate of top left corner.
-
float
y
Y coordinate of top left corner.
-
float
w
width of the bounding box
-
float
h
height of the bounding box
-
unsigned int
class_id
Class identifier of detected object.
-
unsigned int
track_id
Track identifier.
-
float
class_confidence
Confidence of the detection.
Public Static Functions
-
inline