BodyData Struct Reference

Structure containing data of a detected body/person such as its headBoundingBox, id and its 3D position. More...

Attributes

int id
 Body/person identification number. More...
 
string uniqueObjectId
 Unique id to help identify and track AI detections. More...
 
sl.OBJECT_TRACKING_STATE trackingState
 Body/person tracking state. More...
 
sl.OBJECT_ACTION_STATE actionState
 Body/person action state. More...
 
Vector3 position
 Body/person 3D centroid. More...
 
Vector3 velocity
 Body/person 3D velocity. More...
 
float[] positionCovariance
 Covariance matrix of the 3D position. More...
 
float confidence
 Detection confidence value of the body/person. More...
 
System.IntPtr mask
 Mask defining which pixels which belong to the body/person (in boundingBox and set to 255) and those of the background (set to 0). More...
 
Vector2[] boundingBox2D
 2D bounding box of the body/person represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
Vector3 headPosition
 3D centroid of the head of the body/person. More...
 
Vector3 dimensions
 3D body/person dimensions: width, height, length. More...
 
Vector3[] boundingBox
 3D bounding box of the body/person represented as eight 3D points. More...
 
Vector3[] headBoundingBox
 3D bounding box of the head of the body/person represented as eight 3D points. More...
 
Vector2[] headBoundingBox2D
 2D bounding box of the head of the body/person represented as four 2D points starting at the top left corner and rotation clockwise. More...
 
Vector2[] keypoints2D
 Set of useful points representing the human body in 2D. More...
 
Vector3[] keypoints
 Set of useful points representing the human body in 3D. More...
 
float[] keypointConfidence
 Array of detection confidences for each keypoint. More...
 
CovarMatrix[] keypointCovariances
 Array of detection covariance for each keypoint. More...
 
Vector3[] localPositionPerJoint
 Array of local position (position of the child keypoint with respect to its parent expressed in its parent coordinate frame) for each keypoint. More...
 
Quaternion[] localOrientationPerJoint
 Array of local orientation for each keypoint. More...
 
Quaternion globalRootOrientation
 Global root orientation of the skeleton. More...
 

Detailed Description

Structure containing data of a detected body/person such as its headBoundingBox, id and its 3D position.

Variables

◆ id

int id

Body/person identification number.

It is used as a reference when tracking the body through the frames.

Note
Only available if sl.BodyTrackingParameters.enableTracking is activated.
Otherwise, it will be set to -1.

◆ uniqueObjectId

string uniqueObjectId

Unique id to help identify and track AI detections.

It can be either generated externally, or by using sl.Camera.GenerateUniqueID() or left empty.

◆ trackingState

sl.OBJECT_TRACKING_STATE trackingState

Body/person tracking state.

◆ actionState

Body/person action state.

◆ position

Vector3 position

Body/person 3D centroid.

Note
It is defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.

◆ velocity

Vector3 velocity

Body/person 3D velocity.

Note
It is defined in sl.InitParameters.coordinateUnits / s and expressed in sl.RuntimeParameters.measure3DReferenceFrame.

◆ positionCovariance

float [] positionCovariance

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 positionCovariance[i]

◆ confidence

float confidence

Detection confidence value of the body/person.

From 0 to 100, a low value means the body might not be localized perfectly.

◆ mask

System.IntPtr mask

Mask defining which pixels which belong to the body/person (in boundingBox and set to 255) and those of the background (set to 0).

Warning
The mask information is only available for tracked bodies (sl.OBJECT_TRACKING_STATE.OK) that have a valid depth.
Otherwise, the mask will not be initialized.

◆ boundingBox2D

Vector2 [] boundingBox2D

2D bounding box of the body/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.
A ------ B
| Object |
D ------ C

◆ headPosition

Vector3 headPosition

3D centroid of the head of the body/person.

Note
It is defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.

◆ dimensions

Vector3 dimensions

3D body/person dimensions: width, height, length.

Note
It is defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.

◆ boundingBox

Vector3 [] boundingBox

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

Note
It is defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.
1 ------ 2
/ /|
0 ------ 3 |
| Object | 6
| |/
4 ------ 7

◆ headBoundingBox

Vector3 [] headBoundingBox

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

Note
It is defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.

◆ headBoundingBox2D

Vector2 [] headBoundingBox2D

2D bounding box of the head of the body/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.

◆ keypoints2D

Vector2 [] keypoints2D

Set of useful points representing the human body in 2D.

Note
Expressed in pixels on the original image resolution, [0, 0] is the top left corner.
Warning
In some cases, eg. body partially out of the image, some keypoints can not be detected. They will have negatives coordinates.

◆ keypoints

Vector3 [] keypoints

Set of useful points representing the human body in 3D.

Note
They are defined in sl.InitParameters.coordinateUnits and expressed in sl.RuntimeParameters.measure3DReferenceFrame.
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.

◆ keypointConfidence

float [] keypointConfidence

Array of detection confidences for each keypoint.

Note
They can not be lower than the sl.BodyTrackingRuntimeParameters.detectionConfidenceThreshold.
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.

◆ keypointCovariances

CovarMatrix [] keypointCovariances

Array of detection covariance for each keypoint.

Warning
In some cases, eg. body partially out of the image or missing depth data, some keypoints can not be detected. Their covariances will be 0.

◆ localPositionPerJoint

Vector3 [] localPositionPerJoint

Array of local position (position of the child keypoint with respect to its parent expressed in its parent coordinate frame) for each keypoint.

Note
They are expressed in sl.REFERENCE_FRAME.CAMERA or sl.REFERENCE_FRAME.WORLD.
Warning
Not available with sl.BODY_FORMAT.BODY_18.

◆ localOrientationPerJoint

Quaternion [] localOrientationPerJoint

Array of local orientation for each keypoint.

Note
The orientation is represented by a quaternion.
Warning
Not available with sl.BODY_FORMAT.BODY_18.

◆ globalRootOrientation

Quaternion globalRootOrientation

Global root orientation of the skeleton.

The orientation is also represented by a quaternion.

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 sl.BODY_FORMAT.BODY_18.