SpatialMappingParameters Class Reference

Sets the spatial mapping parameters. More...

Functions

def __cinit__ (self, resolution=MAPPING_RESOLUTION.MEDIUM, mapping_range=MAPPING_RANGE.AUTO, max_memory_usage=2048, save_texture=False, use_chunk_only=False, reverse_vertex_order=False, map_type=SPATIAL_MAP_TYPE.MESH)
 Constructor. More...
 
def set_resolution (self, resolution=MAPPING_RESOLUTION.HIGH)
 Sets the resolution corresponding to the given MAPPING_RESOLUTION preset. More...
 
def set_range (self, mapping_range=MAPPING_RANGE.AUTO)
 Sets the range corresponding to the given MAPPING_RANGE preset. More...
 
def get_range_preset (self, mapping_range=MAPPING_RANGE.AUTO)
 Returns the maximum value of depth corresponding to the given MAPPING_RANGE presets. More...
 
def get_resolution_preset (self, resolution=MAPPING_RESOLUTION.HIGH)
 Returns the resolution corresponding to the given MAPPING_RESOLUTION preset. More...
 
def get_recommended_range (self, resolution, Camera py_cam)
 Returns the recommended maximum depth value for the given resolution. More...
 
def map_type (self)
 The type of spatial map to be created. More...
 
def max_memory_usage (self)
 The maximum CPU memory (in mega bytes) allocated for the meshing process.
 
def save_texture (self)
 Set to true if you want to be able to apply the texture to your mesh after its creation. More...
 
def use_chunk_only (self)
 Set to false if you want to ensure consistency between the mesh and its inner chunk data. More...
 
def reverse_vertex_order (self)
 Specify if the order of the vertices of the triangles needs to be inverted. More...
 
def allowed_range (self)
 Gets the range of the minimal/maximal depth value allowed by the spatial mapping in a numpy array. More...
 
def range_meter (self)
 Depth range in meters. More...
 
def allowed_resolution (self)
 Gets the range of the maximal depth value allowed by the spatial mapping in a numpy array. More...
 
def resolution_meter (self)
 Spatial mapping resolution in meters, should fit allowed_resolution.
 
def save (self, str filename)
 Saves the current set of parameters into a file. More...
 
def load (self, str filename)
 Loads the values of the parameters contained in a file. 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

◆ __cinit__()

def __cinit__ (   self,
  resolution = MAPPING_RESOLUTION.MEDIUM,
  mapping_range = MAPPING_RANGE.AUTO,
  max_memory_usage = 2048,
  save_texture = False,
  use_chunk_only = False,
  reverse_vertex_order = False,
  map_type = SPATIAL_MAP_TYPE.MESH 
)

Constructor.

Parameters
resolution: the chosen MAPPING_RESOLUTION
mapping_range: the chosen MAPPING_RANGE
max_memory_usage: the chosen max_memory_usage
save_texture: activates save_texture
use_chunk_only: activates use_chunk_only
reverse_vertex_order: activates reverse_vertex_order
map_type: the chosen map_type
params = sl.SpatialMappingParameters(resolution=MAPPING_RESOLUTION.HIGH)

◆ set_resolution()

def set_resolution (   self,
  resolution = MAPPING_RESOLUTION.HIGH 
)

Sets the resolution corresponding to the given MAPPING_RESOLUTION preset.

Parameters
resolution: the desired MAPPING_RESOLUTION. default : MAPPING_RESOLUTION.HIGH.

◆ set_range()

def set_range (   self,
  mapping_range = MAPPING_RANGE.AUTO 
)

Sets the range corresponding to the given MAPPING_RANGE preset.

Parameters
mapping_range: the desired MAPPING_RANGE . default : MAPPING_RANGE.AUTO

◆ get_range_preset()

def get_range_preset (   self,
  mapping_range = MAPPING_RANGE.AUTO 
)

Returns the maximum value of depth corresponding to the given MAPPING_RANGE presets.

Parameters
range: the desired MAPPING_RANGE . default : MAPPING_RANGE.AUTO
Returns
The maximum value of depth.

◆ get_resolution_preset()

def get_resolution_preset (   self,
  resolution = MAPPING_RESOLUTION.HIGH 
)

Returns the resolution corresponding to the given MAPPING_RESOLUTION preset.

Parameters
resolution: the desired MAPPING_RESOLUTION . default : MAPPING_RESOLUTION.HIGH
Returns
The resolution in meter

◆ get_recommended_range()

def get_recommended_range (   self,
  resolution,
Camera  py_cam 
)

Returns the recommended maximum depth value for the given resolution.

Parameters
resolution: the desired resolution, either defined by a MAPPING_RESOLUTION preset or a resolution value in meters
py_cam: the Camera object which will run the spatial mapping.
Returns
The maximum value of depth in meters.

◆ map_type()

def map_type (   self)

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

◆ save_texture()

def save_texture (   self)

Set to true if you want to be able to apply the texture to your mesh after its creation.

Note
This option will consume more memory.
This option is only available for SPATIAL_MAP_TYPE.MESH

◆ use_chunk_only()

def use_chunk_only (   self)

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.

◆ reverse_vertex_order()

def reverse_vertex_order (   self)

Specify if the order of the vertices of the triangles needs to be inverted.

If your display process does not handle front and back face culling you can use this to set it right.

Note
This option is only available for SPATIAL_MAP_TYPE.MESH

◆ allowed_range()

def allowed_range (   self)

Gets the range of the minimal/maximal depth value allowed by the spatial mapping in a numpy array.

The first value of the array is the minimum value allowed. The second value of the array is the maximum value allowed.

◆ range_meter()

def range_meter (   self)

Depth range in meters.

Can be different from the value set by Camera.set_depth_max_range_value() 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. Deprecated : Since SDK 2.6, we recommend leaving this to 0.

◆ allowed_resolution()

def allowed_resolution (   self)

Gets the range of the maximal depth value allowed by the spatial mapping in a numpy array.

The first value of the array is the minimum value allowed. The second value of the array is the maximum value allowed.

◆ save()

def save (   self,
str  filename 
)

Saves the current set of parameters into a file.

Parameters
filename: the path to the file in which the parameters will be stored.
Returns
true if the file was successfully saved, otherwise false.

◆ load()

def load (   self,
str  filename 
)

Loads the values of the parameters contained in a file.

Parameters
filename: the path to the file from which the parameters will be loaded.
Returns
true if the file was successfully loaded, otherwise false.