ObjectTrackingParameters Class Reference

Structure containing a set of parameters for the object tracking module. More...

Functions

 ObjectTrackingParameters (sl::OBJECT_ACCELERATION_PRESET object_acceleration_preset=sl::OBJECT_ACCELERATION_PRESET::DEFAULT, float velocity_smoothing_factor=-1.f, float min_velocity_threshold=-1.f, float prediction_timeout_s=-1.f, float min_confirmation_time_s=-1.f)
 Default constructor. More...
 
bool save (const String &filename) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (const String &filename)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const ObjectTrackingParameters &param1) const
 
bool operator!= (const ObjectTrackingParameters &param1) const
 

Attributes

sl::OBJECT_ACCELERATION_PRESET object_acceleration_preset
 Preset defining the expected maximum acceleration of the tracked object. More...
 
float velocity_smoothing_factor
 Control the smoothing of the velocity estimation. Manually override the acceleration preset. Values between 0.0 and 1.0. More...
 
float min_velocity_threshold
 Threshold to force an object's velocity to zero. If the calculated speed (m/s) is below this threshold, the object is considered static. This helps eliminate drift on stationary objects. A negative value (e.g. -1) lets the ZED SDK interpret the minimum velocity threshold. Default: -1. More...
 
float prediction_timeout_s
 Duration to keep predicting a track's position after occlusion. When an object is no longer visible (occluded or out of frame), the tracker will predict its position for this duration before deleting the track. More...
 
float min_confirmation_time_s
 Minimum confirmation time required to validate a track. The minimum duration (in seconds) an object must be continuously detected before it is reported as a valid track. Helps filter out spurious false positives that appear only briefly. A negative value (e.g. -1) lets the ZED SDK interpret the minimum confirmation time. Default: -1. More...
 

Detailed Description

Structure containing a set of parameters for the object tracking module.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ ObjectTrackingParameters()

ObjectTrackingParameters ( sl::OBJECT_ACCELERATION_PRESET  object_acceleration_preset = sl::OBJECT_ACCELERATION_PRESET::DEFAULT,
float  velocity_smoothing_factor = -1.f,
float  min_velocity_threshold = -1.f,
float  prediction_timeout_s = -1.f,
float  min_confirmation_time_s = -1.f 
)

Default constructor.

Functions

◆ save()

bool save ( const String filename) const

Saves the current set of parameters into a file to be reloaded with the load() method.

Parameters
filename: Name of the file which will be created to store the parameters (extension '.json' will be added if not set).
Returns
True if the file was successfully saved, otherwise false.
Warning
For security reasons, the file must not already exist.
In case a file already exists, the method will return false and existing file will not be updated.

◆ load()

bool load ( const String filename)

Loads a set of parameters from the values contained in a previously saved file.

Parameters
filename: Path to the file from which the parameters will be loaded (extension '.json' will be added at the end of the filename if not detected).
Returns
True if the file was successfully loaded, otherwise false.

◆ encode()

bool encode ( String serialized_content) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
Returns
True if the decoding was successful, otherwise false.

◆ operator==()

bool operator== ( const ObjectTrackingParameters param1) const

Comparison operator ==

Parameters
param1to compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const ObjectTrackingParameters param1) const

Comparison operator !=

Parameters
param1to compare
Returns
true if the two struct are different

Variables

◆ object_acceleration_preset

sl::OBJECT_ACCELERATION_PRESET object_acceleration_preset

Preset defining the expected maximum acceleration of the tracked object.

Determines how the ZED SDK interprets object acceleration, affecting tracking behavior and predictions.

◆ velocity_smoothing_factor

float velocity_smoothing_factor

Control the smoothing of the velocity estimation. Manually override the acceleration preset. Values between 0.0 and 1.0.

  • High value (closer to 1.0): Very smooth, but may lag behind rapid changes.
  • Low value (closer to 0.0): Very responsive to velocity changes, but may be jittery.
  • 0.5: ZED SDK base tuning. Balanced smoothing and responsiveness. A negative value (e.g. -1) lets the ZED SDK interpret the velocity smoothing factor. Default: -1

◆ min_velocity_threshold

float min_velocity_threshold

Threshold to force an object's velocity to zero. If the calculated speed (m/s) is below this threshold, the object is considered static. This helps eliminate drift on stationary objects. A negative value (e.g. -1) lets the ZED SDK interpret the minimum velocity threshold. Default: -1.

◆ prediction_timeout_s

float prediction_timeout_s

Duration to keep predicting a track's position after occlusion. When an object is no longer visible (occluded or out of frame), the tracker will predict its position for this duration before deleting the track.

  • Short (e.g., 0.2s): Prevents "ghost" objects but may break tracks during short occlusions.
  • Long (e.g., 2.0s): Maintains ID during long occlusions but may report objects that are gone. A negative value (e.g. -1) lets the ZED SDK interpret the prediction timeout. Default: -1

◆ min_confirmation_time_s

float min_confirmation_time_s

Minimum confirmation time required to validate a track. The minimum duration (in seconds) an object must be continuously detected before it is reported as a valid track. Helps filter out spurious false positives that appear only briefly. A negative value (e.g. -1) lets the ZED SDK interpret the minimum confirmation time. Default: -1.