ObjectData Class Reference

Class containing data of a detected object such as its bounding_box, label, id and its 3D position. More...

Functions

 ObjectData ()
 Default constructor. More...
 
 ~ObjectData ()
 Default destructor. More...
 

Attributes

int id
 Object identification number. More...
 
String unique_object_id
 Unique id to help identify and track AI detections. More...
 
int raw_label = 0
 Object raw label. More...
 
OBJECT_CLASS label
 Object class/category to identify the object type. More...
 
OBJECT_SUBCLASS sublabel
 Object sub-class/sub-category to identify the object type. More...
 
OBJECT_TRACKING_STATE tracking_state
 Object tracking state. More...
 
OBJECT_ACTION_STATE action_state
 Object action state. More...
 
sl::float3 position
 Object 3D centroid. More...
 
sl::float3 velocity
 Object 3D velocity. More...
 
float position_covariance [6]
 Covariance matrix of the 3D position. More...
 
std::vector< sl::uint2bounding_box_2d
 2D bounding box of the object represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
sl::Mat mask
 Mask defining which pixels which belong to the object (in bounding_box_2d and set to 255) and those of the background (set to 0). More...
 
float confidence
 Detection confidence value of the object. More...
 
std::vector< sl::float3bounding_box
 3D bounding box of the object represented as eight 3D points. More...
 
sl::float3 dimensions
 3D object dimensions: width, height, length. More...
 
std::vector< sl::uint2head_bounding_box_2d
 2D bounding box of the head of the object (a person) represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
std::vector< sl::float3head_bounding_box
 3D bounding box of the head of the object (a person) represented as eight 3D points. More...
 
sl::float3 head_position
 3D centroid of the head of the object (a person). More...
 

Detailed Description

Class containing data of a detected object such as its bounding_box, label, id and its 3D position.

Constructor and Destructor

◆ ObjectData()

Default constructor.

◆ ~ObjectData()

~ObjectData ( )

Default destructor.

Variables

◆ id

int id

Object identification number.

It is used as a reference when tracking the object through the frames.

Note
Only available if sl::ObjectDetectionParameters.enable_tracking is activated.
Otherwise, it will be set to -1.

◆ unique_object_id

String unique_object_id

Unique id to help identify and track AI detections.

It can be either generated externally, or by using generate_unique_id() or left empty.

◆ raw_label

int raw_label = 0

Object raw label.

It is forwarded from sl::CustomBoxObjectData when using sl::OBJECT_DETECTION_MODEL::CUSTOM_BOX_OBJECTS.

◆ label

OBJECT_CLASS label

Object class/category to identify the object type.

◆ sublabel

OBJECT_SUBCLASS sublabel

Object sub-class/sub-category to identify the object type.

◆ tracking_state

OBJECT_TRACKING_STATE tracking_state

Object tracking state.

◆ action_state

OBJECT_ACTION_STATE action_state

Object action state.

◆ position

sl::float3 position

Object 3D centroid.

Note
It is defined in sl::InitParameters.coordinate_units and expressed in sl::RuntimeParameters.measure3D_reference_frame.

◆ velocity

sl::float3 velocity

Object 3D velocity.

Note
It is defined in sl::InitParameters.coordinate_units / s and expressed in sl::RuntimeParameters.measure3D_reference_frame.

◆ position_covariance

float position_covariance[6]

Covariance matrix of the 3D position.

Note
It is represented by its upper triangular matrix value
= [p0, p1, p2]
[p1, p3, p4]
[p2, p4, p5]
where pi is position_covariance[i]

◆ bounding_box_2d

std::vector<sl::uint2> bounding_box_2d

2D bounding box of the object represented as four 2D points starting at the top left corner and rotation clockwise.

Note
Expressed in pixels on the original image resolution, [0, 0] is the top left corner.
A ------ B
| Object |
D ------ C

◆ mask

sl::Mat mask

Mask defining which pixels which belong to the object (in bounding_box_2d and set to 255) and those of the background (set to 0).

Warning
The mask information is only available for tracked objects (sl::OBJECT_TRACKING_STATE::OK) that have a valid depth.
Otherwise, the mask will not be initialized (mask.isInit() == false).

◆ confidence

float confidence

Detection confidence value of the object.

From 0 to 100, a low value means the object might not be localized perfectly or the label (sl::OBJECT_CLASS) is uncertain.

◆ bounding_box

std::vector<sl::float3> bounding_box

3D bounding box of the object represented as eight 3D points.

Note
It is defined in sl::InitParameters.coordinate_units and expressed in sl::RuntimeParameters.measure3D_reference_frame.
1 ------ 2
/ /|
0 ------ 3 |
| Object | 6
| |/
4 ------ 7

◆ dimensions

sl::float3 dimensions

3D object dimensions: width, height, length.

Note
It is defined in sl::InitParameters.coordinate_units and expressed in sl::RuntimeParameters.measure3D_reference_frame.

◆ head_bounding_box_2d

std::vector<sl::uint2> head_bounding_box_2d

2D bounding box of the head of the object (a person) represented as four 2D points starting at the top left corner and rotation clockwise.

Note
Expressed in pixels on the original image resolution, [0, 0] is the top left corner.
Warning
Not available with sl::OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_XXX.

◆ head_bounding_box

std::vector<sl::float3> head_bounding_box

3D bounding box of the head of the object (a person) represented as eight 3D points.

Note
It is defined in sl::InitParameters.coordinate_units and expressed in sl::RuntimeParameters.measure3D_reference_frame.
Warning
Not available with sl::OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_XXX.

◆ head_position

sl::float3 head_position

3D centroid of the head of the object (a person).

Note
It is defined in sl::InitParameters.coordinate_units and expressed in sl::RuntimeParameters.measure3D_reference_frame.
Warning
Not available with sl::OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_XXX.