SL_ObjectData Struct Reference

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

Data Fields

int id
 Object identification number. More...
 
unsigned char unique_object_id [37]
 Unique id to help identify and track AI detections. More...
 
int raw_label
 Object raw label. More...
 
enum SL_OBJECT_CLASS label
 Object class/category to identify the object type.
 
enum SL_OBJECT_SUBCLASS sublabel
 Object sub-class/sub-category to identify the object type.
 
enum SL_OBJECT_TRACKING_STATE tracking_state
 Object tracking state.
 
enum SL_OBJECT_ACTION_STATE action_state
 Object action state.
 
struct SL_Vector3 position
 Object 3D centroid. More...
 
float confidence
 Detection confidence value of the object. More...
 
int * 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...
 
struct SL_Vector2 bounding_box_2d [4]
 2D bounding box of the object represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
struct SL_Vector3 head_position
 3D centroid of the head of the object (a person). More...
 
struct SL_Vector3 velocity
 Defines the object 3D velocity. More...
 
struct SL_Vector3 dimensions
 3D object dimensions: width, height, length. More...
 
struct SL_Vector3 bounding_box [8]
 3D bounding box of the object represented as eight 3D points. More...
 
struct SL_Vector3 head_bounding_box [8]
 3D bounding box of the head of the object (a person) represented as eight 3D points. More...
 
struct SL_Vector2 head_bounding_box_2d [4]
 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...
 
float position_covariance [6]
 Covariance matrix of the 3D position. More...
 

Detailed Description

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

Field Documentation

◆ id

int SL_ObjectData::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

unsigned char SL_ObjectData::unique_object_id[37]

Unique id to help identify and track AI detections.

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

◆ raw_label

int SL_ObjectData::raw_label

Object raw label.

It is forwarded from SL_CustomBoxObjectData when using SL_OBJECT_DETECTION_MODEL_CUSTOM_BOX_OBJECTS.

◆ position

struct SL_Vector3 SL_ObjectData::position

Object 3D centroid.

Note
It is defined in SL_InitParameters.coordinate_unit and expressed in SL_RuntimeParameters.reference_frame.

◆ confidence

float SL_ObjectData::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.

◆ mask

int* SL_ObjectData::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.

◆ bounding_box_2d

struct SL_Vector2 SL_ObjectData::bounding_box_2d[4]

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

◆ head_position

struct SL_Vector3 SL_ObjectData::head_position

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

Note
It is defined in SL_InitParameters.coordinate_unit and expressed in SL_RuntimeParameters.reference_frame.
Warning
Not available with SL_OBJECT_DETECTION_MODEL_MULTI_CLASS_BOX_XXX.

◆ velocity

struct SL_Vector3 SL_ObjectData::velocity

Defines the object 3D velocity.

Note
It is defined in SL_InitParameters.coordinate_unit / s and expressed in SL_RuntimeParameters.reference_frame.

◆ dimensions

struct SL_Vector3 SL_ObjectData::dimensions

3D object dimensions: width, height, length.

Note
It is defined in SL_InitParameters.coordinate_unit and expressed in SL_RuntimeParameters.reference_frame.

◆ bounding_box

struct SL_Vector3 SL_ObjectData::bounding_box[8]

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

Note
It is defined in SL_InitParameters.coordinate_unit and expressed in SL_RuntimeParameters.reference_frame.
1 ------ 2
/ /|
0 ------ 3 |
| Object | 6
| |/
4 ------ 7

◆ head_bounding_box

struct SL_Vector3 SL_ObjectData::head_bounding_box[8]

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

Note
It is defined in SL_InitParameters.coordinate_unit and expressed in SL_RuntimeParameters.reference_frame.
Warning
Not available with SL_OBJECT_DETECTION_MODEL_MULTI_CLASS_BOX_XXX.

◆ head_bounding_box_2d

struct SL_Vector2 SL_ObjectData::head_bounding_box_2d[4]

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.

◆ position_covariance

float SL_ObjectData::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]