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.OBJECT_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 head_bounding_box (self)
 3D bounding box of the person head, only available in BODY_TRACKING_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 position_covariance (self)
 Position covariance.
 

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

◆ head_bounding_box()

def head_bounding_box (   self)

3D bounding box of the person head, only available in BODY_TRACKING_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)

3D head centroid, only available in DETECTION_MODEL.HUMAN_BODY*.

Defined in InitParameters.coordinate_units, expressed in RuntimeParameters.measure3D_reference_frame