Structure containing a set of parameters for the spatial mapping module. More...
Types | |
enum class | SPATIAL_MAP_TYPE |
Lists the types of spatial maps that can be created. More... | |
enum class | MAPPING_RESOLUTION |
Lists the spatial mapping resolution presets. More... | |
enum class | MAPPING_RANGE |
Lists the spatial mapping depth range presets. More... | |
typedef std::pair< float, float > | interval |
Float pair defining an interval. More... | |
Functions | |
SpatialMappingParameters (MAPPING_RESOLUTION resolution=MAPPING_RESOLUTION::MEDIUM, MAPPING_RANGE range=MAPPING_RANGE::AUTO, int max_memory_usage_=2048, bool save_texture_=false, bool use_chunk_only_=false, bool reverse_vertex_order_=false, SPATIAL_MAP_TYPE map_type=SPATIAL_MAP_TYPE::MESH, int stability_counter=0, float disparity_std=0.3f, float decay=1.f, bool enable_forget_past=false) | |
Default constructor. More... | |
void | set (MAPPING_RESOLUTION mapping_resolution=MAPPING_RESOLUTION::MEDIUM) |
Sets the resolution to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset. More... | |
void | set (MAPPING_RANGE mapping_range=MAPPING_RANGE::MEDIUM) |
Sets the range to a sl::SpatialMappingParameters::MAPPING_RANGE preset. 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 SpatialMappingParameters ¶m1) const |
bool | operator!= (const SpatialMappingParameters ¶m1) const |
Static Functions | |
static float | get (MAPPING_RESOLUTION mapping_resolution=MAPPING_RESOLUTION::MEDIUM) |
Returns the value corresponding to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset in meters. More... | |
static float | get (MAPPING_RANGE mapping_range=MAPPING_RANGE::MEDIUM) |
Returns the value corresponding to a sl::SpatialMappingParameters::MAPPING_RANGE preset in meters. More... | |
static float | getRecommendedRange (MAPPING_RESOLUTION mapping_resolution, Camera &camera) |
Returns the recommended maximum depth value corresponding to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset. More... | |
static float | getRecommendedRange (float resolution_meters, Camera &camera) |
Returns the recommended maximum depth value for the given resolution in meters. More... | |
Attributes | |
float | resolution_meter = 0.05f |
Spatial mapping resolution in meters. More... | |
float | range_meter = 0.f |
Depth range in meters. More... | |
bool | save_texture = false |
Whether to save the texture. More... | |
bool | use_chunk_only = false |
Whether to only use chunks. More... | |
int | max_memory_usage = 2048 |
The maximum CPU memory (in MB) allocated for the meshing process. More... | |
bool | reverse_vertex_order = false |
Whether to inverse the order of the vertices of the triangles. More... | |
SPATIAL_MAP_TYPE | map_type = SPATIAL_MAP_TYPE::MESH |
The type of spatial map to be created. More... | |
int | stability_counter = 0 |
Control the integration rate of the current depth into the mapping 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 |
This parameter enables the forgetting of the previous map to limit memory and drift issues. It enables a local spatial mapping that only keeps a mapped scene around the current camera position. The distance threshold is set to be equal to 1.5 x the range of the spatial mapping. More... | |
Static Attributes | |
static const interval | allowed_resolution |
The resolution allowed by the spatial mapping: More... | |
static const interval | allowed_range |
The maximum depth allowed by spatial mapping: More... | |
Structure containing a set of parameters for the spatial mapping module.
The default constructor sets all parameters to their default settings.
typedef std::pair<float, float> interval |
Float pair defining an interval.
SpatialMappingParameters | ( | MAPPING_RESOLUTION | resolution = MAPPING_RESOLUTION::MEDIUM , |
MAPPING_RANGE | range = MAPPING_RANGE::AUTO , |
||
int | max_memory_usage_ = 2048 , |
||
bool | save_texture_ = false , |
||
bool | use_chunk_only_ = false , |
||
bool | reverse_vertex_order_ = false , |
||
SPATIAL_MAP_TYPE | map_type = SPATIAL_MAP_TYPE::MESH , |
||
int | stability_counter = 0 , |
||
float | disparity_std = 0.3f , |
||
float | decay = 1.f , |
||
bool | enable_forget_past = false |
||
) |
Default constructor.
Sets all parameters to their default and optimized values.
|
static |
Returns the value corresponding to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset in meters.
mapping_resolution | The desired MAPPING_RESOLUTION. Default: MAPPING_RESOLUTION::MEDIUM |
void set | ( | MAPPING_RESOLUTION | mapping_resolution = MAPPING_RESOLUTION::MEDIUM | ) |
Sets the resolution to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset.
mapping_resolution | The desired MAPPING_RESOLUTION. Default: MAPPING_RESOLUTION::MEDIUM |
|
static |
Returns the value corresponding to a sl::SpatialMappingParameters::MAPPING_RANGE preset in meters.
mapping_range | The desired MAPPING_RANGE. Default: MAPPING_RANGE::MEDIUM |
void set | ( | MAPPING_RANGE | mapping_range = MAPPING_RANGE::MEDIUM | ) |
Sets the range to a sl::SpatialMappingParameters::MAPPING_RANGE preset.
mapping_range | The desired MAPPING_RANGE. Default: MAPPING_RANGE::MEDIUM |
|
static |
Returns the recommended maximum depth value corresponding to a sl::SpatialMappingParameters::MAPPING_RESOLUTION preset.
mapping_resolution | The desired MAPPING_RESOLUTION. |
camera | The Camera object that will run the spatial mapping. |
|
static |
Returns the recommended maximum depth value for the given resolution in meters.
resolution_meters | The desired resolution in meters. |
camera | The Camera object that will run the spatial mapping. |
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.
filename | : Name of the file which will be created to store the parameters (extension '.yml' will be added if not set). |
bool load | ( | String | filename, |
SERIALIZATION_FORMAT | format = SERIALIZATION_FORMAT::AUTO |
||
) |
Loads a set of parameters from the values contained in a previously saved file.
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). |
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.
serialized_content | output string containing the JSON Object |
format | serialization format, default is JSON |
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.
serialized_content | input string containing the JSON Object |
format | serialization format, default is JSON |
bool operator== | ( | const SpatialMappingParameters & | param1 | ) | const |
Comparison operator ==
SpatialMappingParameters | to compare |
bool operator!= | ( | const SpatialMappingParameters & | param1 | ) | const |
Comparison operator !=
SpatialMappingParameters | to compare |
float resolution_meter = 0.05f |
Spatial mapping resolution in meters.
|
static |
The resolution allowed by the spatial mapping:
float range_meter = 0.f |
Depth range in meters.
Can be different from the value set by sl::InitParameters::depth_maximum_distance.
|
static |
The maximum depth allowed by spatial mapping:
bool save_texture = false |
Whether to save the texture.
If set to true, you will be able to apply the texture to your mesh after it is created.
bool use_chunk_only = false |
Whether to only use chunks.
If set to false, you will ensure consistency between the mesh and its inner chunk data.
int max_memory_usage = 2048 |
The maximum CPU memory (in MB) allocated for the meshing process.
bool reverse_vertex_order = false |
Whether to inverse the order of the vertices of the triangles.
If your display process does not handle front and back face culling, you can use this to correct it.
SPATIAL_MAP_TYPE map_type = 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 sl::SpatialMappingParameters::SPATIAL_MAP_TYPE.
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: 0 (this will define the stability counter based on the mesh resolution, the higher the resolution, the higher the stability counter)
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.
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.
bool enable_forget_past = false |
This parameter enables the forgetting of the previous map to limit memory and drift issues. It enables a local spatial mapping that only keeps a mapped scene around the current camera position. The distance threshold is set to be equal to 1.5 x the range of the spatial mapping.