SpatialMappingFusionParameters Class Reference

Sets the spatial mapping parameters. More...

Functions

void set (SpatialMappingParameters::MAPPING_RESOLUTION mapping_resolution=SpatialMappingParameters::MAPPING_RESOLUTION::MEDIUM)
 Sets the resolution corresponding to the given MAPPING_RESOLUTION preset. More...
 
void set (SpatialMappingParameters::MAPPING_RANGE mapping_range=SpatialMappingParameters::MAPPING_RANGE::MEDIUM)
 Sets the maximum value of the depth corresponding to the given MAPPING_RANGE preset. More...
 
bool save (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) 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::JSON)
 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 SpatialMappingFusionParameters &param1) const
 Comparison operator ==. More...
 
bool operator!= (const SpatialMappingFusionParameters &param1) const
 Comparison operator !=. More...
 

Attributes

float resolution_meter = 0.05f
 Spatial mapping resolution in meters. Should fit allowed_resolution. More...
 
float range_meter = 0.f
 Depth range in meters. Can be different from the value set by sl::InitParameters::depth_maximum_distance.
Set to 0 by default. In this case, the range is computed from resolution_meter and from the current internal parameters to fit your application. More...
 
bool use_chunk_only = false
 Set to false if you want to ensure consistency between the mesh and its inner chunk data. More...
 
int max_memory_usage = 2048
 The maximum CPU memory (in MB) allocated for the meshing process. More...
 
float disparity_std = 0.3
 Control the disparity noise (standard deviation) in px. set a very small value (<0.1) if the depth map of the scene is accurate. set a big value (>0.5) if the depth map is noisy. More...
 
float decay = 1
 Adjust the weighting factor for the current depth during the integration process. By default, the value is set to 1, which results in the complete integration and fusion of the current depth with the previously integrated depth. Setting it to 0 discards all previous data and solely integrates the current depth. More...
 
bool enable_forget_past = false
 
int stability_counter = 0
 Control the integration rate of the current depth into the mapping process. This parameter controls how many times a stable 3D points should be seen before it is integrated into the spatial mapping. Default value is 0, this will define the stability counter based on the mesh resolution, the higher the resolution, the higher the stability counter. More...
 
SpatialMappingParameters::SPATIAL_MAP_TYPE map_type = SpatialMappingParameters::SPATIAL_MAP_TYPE::MESH
 The type of spatial map to be created. This dictates the format that will be used for the mapping(e.g. mesh, point cloud). See SPATIAL_MAP_TYPE. More...
 

Detailed Description

Sets the spatial mapping parameters.

Instantiating with the default constructor will set all parameters to their default values.
You can customize these values to fit your application, and then save them to a preset to be loaded in future executions.

Note
Users can adjust these parameters as they see fit.

Functions

◆ set() [1/2]

Sets the resolution corresponding to the given MAPPING_RESOLUTION preset.

Parameters
mapping_resolutionThe desired MAPPING_RESOLUTION. Default: MAPPING_RESOLUTION::MEDIUM.

◆ set() [2/2]

Sets the maximum value of the depth corresponding to the given MAPPING_RANGE preset.

Parameters
mapping_rangeThe desired MAPPING_RANGE. Default: MAPPING_RANGE::MEDIUM.

◆ save()

bool save ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) 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::JSON 
)

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 SpatialMappingFusionParameters param1) const

Comparison operator ==.

Parameters
SpatialMappingParametersto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const SpatialMappingFusionParameters param1) const

Comparison operator !=.

Parameters
SpatialMappingParametersto compare
Returns
true if the two struct are different

Variables

◆ resolution_meter

float resolution_meter = 0.05f

Spatial mapping resolution in meters. Should fit allowed_resolution.

◆ range_meter

float range_meter = 0.f

Depth range in meters. Can be different from the value set by sl::InitParameters::depth_maximum_distance.
Set to 0 by default. In this case, the range is computed from resolution_meter and from the current internal parameters to fit your application.

◆ use_chunk_only

bool use_chunk_only = false

Set to false if you want to ensure consistency between the mesh and its inner chunk data.

Note
Updating the mesh is time-consuming. Setting this to true results in better performance.

◆ max_memory_usage

int max_memory_usage = 2048

The maximum CPU memory (in MB) allocated for the meshing process.

◆ disparity_std

float disparity_std = 0.3

Control the disparity noise (standard deviation) in px. set a very small value (<0.1) if the depth map of the scene is accurate. set a big value (>0.5) if the depth map is noisy.

◆ decay

float decay = 1

Adjust the weighting factor for the current depth during the integration process. By default, the value is set to 1, which results in the complete integration and fusion of the current depth with the previously integrated depth. Setting it to 0 discards all previous data and solely integrates the current depth.

◆ enable_forget_past

bool enable_forget_past = false

◆ stability_counter

int stability_counter = 0

Control the integration rate of the current depth into the mapping process. This parameter controls how many times a stable 3D points should be seen before it is integrated into the spatial mapping. Default value is 0, this will define the stability counter based on the mesh resolution, the higher the resolution, the higher the stability counter.

◆ map_type

The type of spatial map to be created. This dictates the format that will be used for the mapping(e.g. mesh, point cloud). See SPATIAL_MAP_TYPE.