ObjectData Class Reference

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

Functions

def id (self)
 Object identification number, used as a reference when tracking the object through the frames. More...
 
def unique_object_id (self)
 Unique ID to help identify and track AI detections. More...
 
def raw_label (self)
 Object label, forwarded from CustomBoxObjectData when using sl.DETECTION_MODEL.CUSTOM_BOX_OBJECTS.
 
def label (self)
 Object category. More...
 
def sublabel (self)
 Object sublabel. More...
 
def tracking_state (self)
 Defines the object tracking state. More...
 
def action_state (self)
 Defines the object action state. More...
 
def position (self)
 Defines the object 3D centroid. More...
 
def velocity (self)
 Defines the object 3D velocity. More...
 
def bounding_box (self)
 3D bounding box of the person represented as eight 3D points. More...
 
def bounding_box_2d (self)
 2D bounding box of the person represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
def confidence (self)
 Defines the detection confidence value of the object. More...
 
def mask (self)
 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...
 
def dimensions (self)
 3D object dimensions: width, height, length More...
 
def keypoint (self)
 A set of useful points representing the human body, expressed in 3D and only available in DETECTION_MODEL.HUMAN_BODY*. More...
 
def keypoint_2d (self)
 2D keypoint of the object, only available in DETECTION_MODEL.HUMAN_BODY* More...
 
def head_bounding_box (self)
 3D bounding box of the person head, only available in DETECTION_MODEL.HUMAN_BODY*, represented as eight 3D points. More...
 
def head_bounding_box_2d (self)
 2D bounding box of the person head, only available in DETECTION_MODEL.HUMAN_BODY*, represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
def head_position (self)
 3D head centroid, only available in DETECTION_MODEL.HUMAN_BODY*. More...
 
def keypoint_confidence (self)
 Per keypoint detection confidence, can not be lower than the ObjectDetectionRuntimeParameters.detection_confidence_threshold. More...
 
def local_position_per_joint (self)
 Per keypoint local position (the position of the child keypoint with respect to its parent expressed in its parent coordinate frame) More...
 
def local_orientation_per_joint (self)
 Per keypoint local orientation. More...
 
def global_root_orientation (self)
 Global root orientation of the skeleton. More...
 

Detailed Description

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

Functions

◆ id()

def id (   self)

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

Note
Is set to -1 if the object is not currently tracked.

◆ unique_object_id()

def unique_object_id (   self)

Unique ID to help identify and track AI detections.

Can be either generated externally, or using generate_unique_id() or left empty

◆ label()

def label (   self)

Object category.

Identifies the object type. Can have the following values: OBJECT_CLASS

◆ sublabel()

def sublabel (   self)

Object sublabel.

Identifies the object subclass. Can have the following values: OBJECT_SUBCLASS

◆ tracking_state()

def tracking_state (   self)

Defines the object tracking state.

Can have the following values: OBJECT_TRACKING_STATE

◆ action_state()

def action_state (   self)

Defines the object action state.

Can have the following values: OBJECT_ACTION_STATE

◆ position()

def position (   self)

Defines the object 3D centroid.

Defined in InitParameters.coordinate_units, expressed in RuntimeParameters.measure3D_reference_frame

◆ velocity()

def velocity (   self)

Defines the object 3D velocity.

Defined in InitParameters.coordinate_units / s , expressed in RuntimeParameters.measure3D_reference_frame

◆ bounding_box()

def bounding_box (   self)

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

Defined in InitParameters.coordinate_units, expressed in RuntimeParameters.measure3D_reference_frame

1 ------ 2
/ /|
0 ------ 3 |
| Object | 6
| |/
4 ------ 7
Note
Only available if ObjectDetectionParameters.enable_tracking is activated

◆ bounding_box_2d()

def bounding_box_2d (   self)

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, where [0,0] is the top left corner.

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

◆ confidence()

def confidence (   self)

Defines the detection confidence value of the object.

Values can range from 0 to 100, where lower confidence values mean that the object might not be localized perfectly or that the label (OBJECT_CLASS) is uncertain.

◆ mask()

def mask (   self)

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 available only for tracked objects (OBJECT_TRACKING_STATE.OK) that have a valid depth. Otherwise, it will not be initialized (mask.is_init == False)

◆ dimensions()

def dimensions (   self)

3D object dimensions: width, height, length

Note
Only available if ObjectDetectionParameters.enable_tracking is activated

◆ keypoint()

def keypoint (   self)

A set of useful points representing the human body, expressed in 3D and only available in DETECTION_MODEL.HUMAN_BODY*.

We use a classic 18 points representation, the keypoint semantic and order is given by BODY_PARTS Defined in InitParameters.coordinate_units, expressed in RuntimeParameters.measure3D_reference_frame

Warning
in some cases, eg. body partially out of the image, some keypoints can not be detected, they will have negative coordinates.

◆ keypoint_2d()

def keypoint_2d (   self)

2D keypoint of the object, only available in DETECTION_MODEL.HUMAN_BODY*

Warning
in some cases, eg. body partially out of the image or missing depth data, some keypoints can not be detected, they will have non finite values.

◆ head_bounding_box()

def head_bounding_box (   self)

3D bounding box of the person head, only available in DETECTION_MODEL.HUMAN_BODY*, represented as eight 3D points.

Defined in InitParameters.coordinate_units, expressed in RuntimeParameters.measure3D_reference_frame

◆ head_bounding_box_2d()

def head_bounding_box_2d (   self)

2D bounding box of the person head, only available in DETECTION_MODEL.HUMAN_BODY*, represented as four 2D points starting at the top left corner and rotation clockwise.

Expressed in pixels on the original image resolution.

◆ head_position()

def head_position (   self)

◆ keypoint_confidence()

def keypoint_confidence (   self)

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 keypoints can not be detected, they will have non finite values.

◆ local_position_per_joint()

def local_position_per_joint (   self)

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 sl.REFERENCE_FRAME.CAMERA or sl.REFERENCE_FRAME.WORLD
Warning
Not available with DETECTION_MODEL.MULTI_CLASS_BOX* and with sl.BODY_FORMAT.POSE_18.

◆ local_orientation_per_joint()

def local_orientation_per_joint (   self)

Per keypoint local orientation.

Note
the orientation is represented by a quaternion which is stored in a numpy array of size 4 [qx,qy,qz,qw]
Warning
Not available with DETECTION_MODEL.MULTI_CLASS_BOX* and with sl.BODY_FORMAT.POSE_18.

◆ global_root_orientation()

def global_root_orientation (   self)

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.