RuntimeParameters Struct Reference

Structure containing parameters that defines the behavior of sl::Camera::grab(). More...

Functions

 RuntimeParameters (bool enable_depth_=true, bool enable_fill_mode_=false, int confidence_threshold_=95, int texture_confidence_threshold_=100, REFERENCE_FRAME measure3D_reference_frame_=REFERENCE_FRAME::CAMERA, bool remove_saturated_areas_=true)
 Default constructor. More...
 
bool save (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::LEGACY) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::AUTO)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) 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, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const RuntimeParameters &param1) const
 
bool operator!= (const RuntimeParameters &param1) const
 

Attributes

REFERENCE_FRAME measure3D_reference_frame
 Reference frame in which to provides the 3D measures (point cloud, normals, etc.). More...
 
bool enable_depth
 Defines if the depth map should be computed. More...
 
bool enable_fill_mode = false
 Defines if the depth map should be completed or not. More...
 
int confidence_threshold = 95
 Threshold to reject depth values based on their confidence. More...
 
int texture_confidence_threshold = 100
 Threshold to reject depth values based on their texture confidence. More...
 
bool remove_saturated_areas = true
 Defines if the saturated area (luminance>=255) must be removed from depth map estimation. More...
 

Detailed Description

Structure containing parameters that defines the behavior of sl::Camera::grab().

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ RuntimeParameters()

RuntimeParameters ( bool  enable_depth_ = true,
bool  enable_fill_mode_ = false,
int  confidence_threshold_ = 95,
int  texture_confidence_threshold_ = 100,
REFERENCE_FRAME  measure3D_reference_frame_ = REFERENCE_FRAME::CAMERA,
bool  remove_saturated_areas_ = true 
)

Default constructor.

All the parameters are set to their default values.

Functions

◆ save()

bool save ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::LEGACY 
) 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 '.yml' 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 ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::AUTO 
)

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 '.yml' 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,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) 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
formatserialization format, default is JSON
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

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

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

◆ operator==()

bool operator== ( const RuntimeParameters param1) const

Comparison operator ==

Parameters
RuntimeParametersto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const RuntimeParameters param1) const

Comparison operator !=

Parameters
RuntimeParametersto compare
Returns
true if the two struct are different

Variables

◆ measure3D_reference_frame

REFERENCE_FRAME measure3D_reference_frame

Reference frame in which to provides the 3D measures (point cloud, normals, etc.).

Default: sl::REFERENCE_FRAME::CAMERA

◆ enable_depth

bool enable_depth

Defines if the depth map should be computed.

Default: true

Note
If set to false, only the images are available.

◆ enable_fill_mode

bool enable_fill_mode = false

Defines if the depth map should be completed or not.

Default: false

Note
It is similar to the removed sl::SENSING_MODE::FILL.
Warning
Enabling this will override the confidence values confidence_threshold and texture_confidence_threshold as well as remove_saturated_areas.

◆ confidence_threshold

int confidence_threshold = 95

Threshold to reject depth values based on their confidence.

Each depth pixel has a corresponding confidence (sl::MEASURE::CONFIDENCE) in the range [1, 100].
Decreasing this value will remove depth data from both objects edges and low textured areas, to keep only confident depth estimation data.
Default: 95

Note
Pixels with a value close to 100 are not to be trusted. Accurate depth pixels tends to be closer to lower values.
It can be seen as a probability of error, scaled to 100.

◆ texture_confidence_threshold

int texture_confidence_threshold = 100

Threshold to reject depth values based on their texture confidence.

The texture confidence range is [1, 100].
Decreasing this value will remove depth data from image areas which are uniform.
Default: 100 (no depth pixel will be rejected)

Note
Pixels with a value close to 100 are not to be trusted. Accurate depth pixels tends to be closer to lower values.

◆ remove_saturated_areas

bool remove_saturated_areas = true

Defines if the saturated area (luminance>=255) must be removed from depth map estimation.

Default: true

Note
It is recommended to keep this parameter at true because saturated area can create false detection.