ObjectData Class Reference

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

Functions

 ObjectData ()
 
 ~ObjectData ()
 

Attributes

int id
 Object identification number, used as a reference when tracking the object through the frames. More...
 
String unique_object_id
 Unique ID to help identify and track AI detections. Can be either generated externally, or using generate_unique_id() or left empty. More...
 
int raw_label = 0
 Object label, forwarded from CustomBoxObjectData when using DETECTION_MODEL::CUSTOM_BOX_OBJECTS. More...
 
OBJECT_CLASS label
 Object category. Identify the object type. More...
 
OBJECT_SUBCLASS sublabel
 Object subclass. More...
 
OBJECT_TRACKING_STATE tracking_state
 Defines the object tracking state. More...
 
OBJECT_ACTION_STATE action_state
 Defines the object action state. More...
 
sl::float3 position
 Defines the object 3D centroid. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
sl::float3 velocity
 Defines the object 3D velocity Defined in sl:InitParameters::UNIT / seconds, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
float position_covariance [6]
 the covariance matrix of the 3d position, represented by its upper triangular matrix value More...
 
std::vector< sl::uint2bounding_box_2d
 2D bounding box of the person represented as four 2D points starting at the top left corner and rotation clockwise. Expressed in pixels on the original image resolution, [0,0] is the top left corner. More...
 
sl::Mat mask
 Defines for the bounding_box_2d the pixels which really belong to the object (set to 255) and those of the background (set to 0). More...
 
float confidence
 Defines the detection confidence value of the object. From 0 to 100, a low value means the object might not be localized perfectly or the label (OBJECT_CLASS) is uncertain. More...
 
std::vector< sl::float3bounding_box
 3D bounding box of the person represented as eight 3D points Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
sl::float3 dimensions
 3D object dimensions: width, height, length Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
std::vector< sl::float2keypoint_2d
 A set of useful points representing the human body, expressed in 2D, respect to the original image resolution. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS. Expressed in pixels on the original image resolution, [0,0] is the top left corner. More...
 
std::vector< sl::float3keypoint
 A set of useful points representing the human body, expressed in 3D. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
std::vector< sl::uint2head_bounding_box_2d
 bounds the head with four 2D points. Expressed in pixels on the original image resolution. More...
 
std::vector< sl::float3head_bounding_box
 bounds the head with eight 3D points. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
sl::float3 head_position
 3D head centroid. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame. More...
 
std::vector< float > keypoint_confidence
 Per keypoint detection confidence, can not be lower than the ObjectDetectionRuntimeParameters::detection_confidence_threshold. More...
 
std::vector< sl::float3local_position_per_joint
 Per keypoint local position (the position of the child keypoint with respect to its parent expressed in its parent coordinate frame) More...
 
std::vector< sl::float4local_orientation_per_joint
 Per keypoint local orientation. More...
 
sl::float4 global_root_orientation
 global root orientation of the skeleton. The orientation is also represented by a quaternion with the same format as local_orientation_per_joint More...
 

Detailed Description

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

Constructor and Destructor

◆ ObjectData()

◆ ~ObjectData()

~ObjectData ( )

Variables

◆ id

int id

Object identification number, used as a reference when tracking the object through the frames.

Note
Only available if ObjectDetectionParameters::enable_tracking is activated else set to -1.

◆ unique_object_id

String unique_object_id

Unique ID to help identify and track AI detections. Can be either generated externally, or using generate_unique_id() or left empty.

◆ raw_label

int raw_label = 0

Object label, forwarded from CustomBoxObjectData when using DETECTION_MODEL::CUSTOM_BOX_OBJECTS.

◆ label

OBJECT_CLASS label

Object category. Identify the object type.

◆ sublabel

OBJECT_SUBCLASS sublabel

Object subclass.

◆ tracking_state

OBJECT_TRACKING_STATE tracking_state

Defines the object tracking state.

◆ action_state

OBJECT_ACTION_STATE action_state

Defines the object action state.

◆ position

sl::float3 position

Defines the object 3D centroid. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

◆ velocity

sl::float3 velocity

Defines the object 3D velocity Defined in sl:InitParameters::UNIT / seconds, expressed in RuntimeParameters::measure3D_reference_frame.

◆ position_covariance

float position_covariance[6]

the covariance matrix of the 3d position, 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 person represented as four 2D points starting at the top left corner and rotation clockwise. Expressed in pixels on the original image resolution, [0,0] is the top left corner.

A ------ B
| Object |
D ------ C

◆ mask

sl::Mat mask

Defines for the bounding_box_2d the pixels which really belong to the object (set to 255) and those of the background (set to 0).

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

◆ confidence

float confidence

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

◆ bounding_box

std::vector<sl::float3> bounding_box

3D bounding box of the person represented as eight 3D points Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

1 ------ 2
/ /|
0 ------ 3 |
| Object | 6
| |/
4 ------ 7

◆ dimensions

sl::float3 dimensions

3D object dimensions: width, height, length Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

◆ keypoint_2d

std::vector<sl::float2> keypoint_2d

A set of useful points representing the human body, expressed in 2D, respect to the original image resolution. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS. Expressed in pixels on the original image resolution, [0,0] is the top left corner.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX.
Warning
in some cases, eg. body partially out of the image, some keypoint can not be detected, they will have negatives coordinates.

◆ keypoint

std::vector<sl::float3> keypoint

A set of useful points representing the human body, expressed in 3D. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX.
Warning
in some cases, eg. body partially out of the image or missing depth data, some keypoint can not be detected, they will have non finite values.

◆ head_bounding_box_2d

std::vector<sl::uint2> head_bounding_box_2d

bounds the head with four 2D points. Expressed in pixels on the original image resolution.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX.

◆ head_bounding_box

std::vector<sl::float3> head_bounding_box

bounds the head with eight 3D points. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX.

◆ head_position

sl::float3 head_position

3D head centroid. Defined in sl:InitParameters::UNIT, expressed in RuntimeParameters::measure3D_reference_frame.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX*.

◆ keypoint_confidence

std::vector<float> keypoint_confidence

Per keypoint detection confidence, can not be lower than the ObjectDetectionRuntimeParameters::detection_confidence_threshold.

Note
Not available with DETECTION_MODEL::MULTI_CLASS_BOX*.
Warning
in some cases, eg. body partially out of the image or missing depth data, some keypoint can not be detected, they will have non finite values.

◆ local_position_per_joint

std::vector<sl::float3> local_position_per_joint

Per keypoint local position (the position of the child keypoint with respect to its parent expressed in its parent coordinate frame)

Note
it is expressed in REFERENCE_FRAME::CAMERA or REFERENCE_FRAME::WORLD
Warning
Not available with DETECTION_MODEL::MULTI_CLASS_BOX* and with sl::BODY_FORMAT::POSE_18.

◆ local_orientation_per_joint

std::vector<sl::float4> local_orientation_per_joint

Per keypoint local orientation.

Note
the orientation is represented by a quaternion which is stored in sl::float4 (sl::float4 q = sl::float4(qx,qy,qz,qw);)
Warning
Not available with DETECTION_MODEL::MULTI_CLASS_BOX* and with sl::BODY_FORMAT::POSE_18.

◆ global_root_orientation

sl::float4 global_root_orientation

global root orientation of the skeleton. The orientation is also represented by a quaternion with the same format as local_orientation_per_joint

Note
the global root position is already accessible in keypoint attribute by using the root index of a given sl::BODY_FORMAT
Warning
Not available with DETECTION_MODEL::MULTI_CLASS_BOX* and with sl::BODY_FORMAT::POSE_18.