CustomObjectDetectionProperties Class Reference

Structure containing a set of runtime properties of a certain class ID for the object detection module using a custom model. More...

Functions

 CustomObjectDetectionProperties (const bool enabled=true, const float detection_confidence_threshold=20.f, const bool is_grounded=true, const bool is_static=false, const float tracking_timeout=-1.f, const float tracking_max_dist=-1.f, const float max_box_width_normalized=-1.f, const float min_box_width_normalized=-1.f, const float max_box_height_normalized=-1.f, const float min_box_height_normalized=-1.f, const float max_box_width_meters=-1.f, const float min_box_width_meters=-1.f, const float max_box_height_meters=-1.f, const float min_box_height_meters=-1.f, const sl::OBJECT_SUBCLASS native_mapped_class=sl::OBJECT_SUBCLASS::LAST, const sl::OBJECT_ACCELERATION_PRESET object_acceleration_preset=sl::OBJECT_ACCELERATION_PRESET::DEFAULT, const float max_allowed_acceleration=std::numeric_limits< float >::quiet_NaN())
 
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 CustomObjectDetectionProperties &props) const
 
bool operator!= (const CustomObjectDetectionProperties &props) const
 

Attributes

bool enabled
 Whether the object object is kept or not. More...
 
float detection_confidence_threshold
 Confidence threshold. More...
 
bool is_grounded
 Provide hypothesis about the object movements (degrees of freedom or DoF) to improve the object tracking. More...
 
bool is_static
 Provide hypothesis about the object staticity to improve the object tracking. More...
 
float tracking_timeout
 Maximum tracking time threshold (in seconds) before dropping the tracked object when unseen for this amount of time. More...
 
float tracking_max_dist
 Maximum tracking distance threshold (in meters) before dropping the tracked object when unseen for this amount of meters. More...
 
float max_box_width_normalized
 Maximum allowed width normalized to the image size. More...
 
float min_box_width_normalized
 Minimum allowed width normalized to the image size. More...
 
float max_box_height_normalized
 Maximum allowed height normalized to the image size. More...
 
float min_box_height_normalized
 Minimum allowed height normalized to the image size. More...
 
float max_box_width_meters
 Maximum allowed 3D width. More...
 
float min_box_width_meters
 Minimum allowed 3D width. More...
 
float max_box_height_meters
 Maximum allowed 3D height. More...
 
float min_box_height_meters
 Minimum allowed 3D height. More...
 
sl::OBJECT_SUBCLASS native_mapped_class
 For increased accuracy, the native sl::OBJECT_SUBCLASS mapping, if any. More...
 
sl::OBJECT_ACCELERATION_PRESET object_acceleration_preset
 Preset defining the expected maximum acceleration of the tracked object. More...
 
float max_allowed_acceleration
 Manually override the acceleration preset. More...
 

Detailed Description

Structure containing a set of runtime properties of a certain class ID for the object detection module using a custom model.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ CustomObjectDetectionProperties()

CustomObjectDetectionProperties ( const bool  enabled = true,
const float  detection_confidence_threshold = 20.f,
const bool  is_grounded = true,
const bool  is_static = false,
const float  tracking_timeout = -1.f,
const float  tracking_max_dist = -1.f,
const float  max_box_width_normalized = -1.f,
const float  min_box_width_normalized = -1.f,
const float  max_box_height_normalized = -1.f,
const float  min_box_height_normalized = -1.f,
const float  max_box_width_meters = -1.f,
const float  min_box_width_meters = -1.f,
const float  max_box_height_meters = -1.f,
const float  min_box_height_meters = -1.f,
const sl::OBJECT_SUBCLASS  native_mapped_class = sl::OBJECT_SUBCLASS::LAST,
const sl::OBJECT_ACCELERATION_PRESET  object_acceleration_preset = sl::OBJECT_ACCELERATION_PRESET::DEFAULT,
const float  max_allowed_acceleration = std::numeric_limits< float >::quiet_NaN() 
)

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 CustomObjectDetectionProperties props) const

Comparison operator ==

Parameters
propsCustomObjectDetectionProperties to compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const CustomObjectDetectionProperties props) const

Comparison operator !=

Parameters
propsCustomObjectDetectionProperties to compare
Returns
true if the two struct are different

Variables

◆ enabled

bool enabled

Whether the object object is kept or not.

◆ detection_confidence_threshold

float detection_confidence_threshold

Confidence threshold.

From 1 to 100, with 1 meaning a low threshold, more uncertain objects and 99 very few but very precise objects.
Default: 20.f

Note
If the scene contains a lot of objects, increasing the confidence can slightly speed up the process, since every object instance is tracked.

◆ is_grounded

bool is_grounded

Provide hypothesis about the object movements (degrees of freedom or DoF) to improve the object tracking.

  • true: 2 DoF projected alongside the floor plane. Case for object standing on the ground such as person, vehicle, etc.
    The projection implies that the objects cannot be superposed on multiple horizontal levels.
  • false: 6 DoF (full 3D movements are allowed).
Note
This parameter cannot be changed for a given object tracking id.
It is advised to set it by labels to avoid issues.

◆ is_static

bool is_static

Provide hypothesis about the object staticity to improve the object tracking.

  • true: the object will be assumed to never move nor being moved.
  • false: the object will be assumed to be able to move or being moved.

◆ tracking_timeout

float tracking_timeout

Maximum tracking time threshold (in seconds) before dropping the tracked object when unseen for this amount of time.

By default, let the tracker decide internally based on the internal sub class of the tracked object.

◆ tracking_max_dist

float tracking_max_dist

Maximum tracking distance threshold (in meters) before dropping the tracked object when unseen for this amount of meters.

By default, do not discard tracked object based on distance. Only valid for static object.

◆ max_box_width_normalized

float max_box_width_normalized

Maximum allowed width normalized to the image size.

Any prediction bigger than that will be filtered out. Default: -1 (no filtering)

◆ min_box_width_normalized

float min_box_width_normalized

Minimum allowed width normalized to the image size.

Any prediction smaller than that will be filtered out. Default: -1 (no filtering)

◆ max_box_height_normalized

float max_box_height_normalized

Maximum allowed height normalized to the image size.

Any prediction bigger than that will be filtered out. Default: -1 (no filtering)

◆ min_box_height_normalized

float min_box_height_normalized

Minimum allowed height normalized to the image size.

Any prediction smaller than that will be filtered out. Default: -1 (no filtering)

◆ max_box_width_meters

float max_box_width_meters

Maximum allowed 3D width.

Any prediction bigger than that will be either discarded (if object is tracked and in SEARCHING state) or clamped. Default: -1 (no filtering)

◆ min_box_width_meters

float min_box_width_meters

Minimum allowed 3D width.

Any prediction smaller than that will be either discarded (if object is tracked and in SEARCHING state) or clamped. Default: -1 (no filtering)

◆ max_box_height_meters

float max_box_height_meters

Maximum allowed 3D height.

Any prediction bigger than that will be either discarded (if object is tracked and in SEARCHING state) or clamped. Default: -1 (no filtering)

◆ min_box_height_meters

float min_box_height_meters

Minimum allowed 3D height.

Any prediction smaller than that will be either discarded (if object is tracked and in SEARCHING state) or clamped. Default: -1 (no filtering)

◆ native_mapped_class

sl::OBJECT_SUBCLASS native_mapped_class

For increased accuracy, the native sl::OBJECT_SUBCLASS mapping, if any.

Native objects have refined internal parameters for better 3D projection and tracking accuracy. If one of the custom objects can be mapped to one the native sl::OBJECT_SUBCLASS, this can help to boost the tracking accuracy.

Default: no mapping

◆ 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.

◆ max_allowed_acceleration

float max_allowed_acceleration

Manually override the acceleration preset.

If set, this value takes precedence over the selected preset, allowing for a custom maximum acceleration. Unit is m/s^2.