ObjectData Class Reference

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

Functions

int id (self)
 Object identification number. More...
 
str unique_object_id (self)
 Unique id to help identify and track AI detections. More...
 
int raw_label (self)
 Object raw label. More...
 
OBJECT_CLASS label (self)
 Object class/category to identify the object type.
 
OBJECT_SUBCLASS sublabel (self)
 Object sub-class/sub-category to identify the object type.
 
OBJECT_TRACKING_STATE tracking_state (self)
 Object tracking state.
 
OBJECT_ACTION_STATE action_state (self)
 Object action state.
 
np.array[float] position (self)
 Object 3D centroid. More...
 
np.array[float] velocity (self)
 Object 3D velocity. More...
 
np.array[float][float] bounding_box (self)
 3D bounding box of the object represented as eight 3D points. More...
 
np.array[int][int] bounding_box_2d (self)
 2D bounding box of the object represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
float confidence (self)
 Detection confidence value of the object. More...
 
Mat mask (self)
 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...
 
np.array[float] dimensions (self)
 3D object dimensions: width, height, length. More...
 
np.array[float][float] head_bounding_box (self)
 3D bounding box of the head of the object (a person) represented as eight 3D points. More...
 
np.array[int][int] head_bounding_box_2d (self)
 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...
 
np.array[float] head_position (self)
 3D centroid of the head of the object (a person). More...
 
np.array[float] position_covariance (self)
 Covariance matrix of the 3D position. More...
 

Detailed Description

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

Functions

◆ id()

int id (   self)

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()

str unique_object_id (   self)

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 (   self)

Object raw label.

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

◆ position()

np.array[float] position (   self)

Object 3D centroid.

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

◆ velocity()

np.array[float] velocity (   self)

Object 3D velocity.

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

◆ bounding_box()

np.array[float][float] bounding_box (   self)

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

◆ bounding_box_2d()

np.array[int][int] bounding_box_2d (   self)

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

◆ confidence()

float confidence (   self)

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()

Mat mask (   self)

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.is_init() == False).

◆ dimensions()

np.array[float] dimensions (   self)

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()

np.array[float][float] head_bounding_box (   self)

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_bounding_box_2d()

np.array[int][int] head_bounding_box_2d (   self)

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_position()

np.array[float] head_position (   self)

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.

◆ position_covariance()

np.array[float] position_covariance (   self)

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]