SpatialMappingParameters Class Reference

Sets the spatial mapping parameters. More...

Types

typedef std::pair< float, float > interval
 

General 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)
 Default constructor, set all parameters to their default and optimized values. More...
 
void set (MAPPING_RESOLUTION mapping_resolution=MAPPING_RESOLUTION_MEDIUM)
 Sets the resolution corresponding to the given RESOLUTION preset. More...
 
void set (MAPPING_RANGE mapping_range=MAPPING_RANGE_MEDIUM)
 Sets the maximum value of depth corresponding to the given RANGE presets. More...
 
bool save (String filename)
 Saves the current set of parameters into a file. More...
 
bool load (String filename)
 Loads the values of the parameters contained in a file. More...
 

Static Functions

static float get (MAPPING_RESOLUTION mapping_resolution=MAPPING_RESOLUTION_MEDIUM)
 Return the resolution corresponding to the given RESOLUTION preset. More...
 
static float getRecommendedRange (MAPPING_RESOLUTION mapping_resolution, Camera &camera)
 Return the recommanded maximum depth value for the given MAPPING_RESOLUTION preset. More...
 
static float getRecommendedRange (float resolution_meters, Camera &camera)
 Return the recommanded maximum depth value for the given MAPPING_RESOLUTION preset. More...
 
static float get (MAPPING_RANGE mapping_range=MAPPING_RANGE_MEDIUM)
 Return the maximum value of depth corresponding to the given RANGE presets. More...
 

Attributes

float resolution_meter = 0.05f
 Spatial mapping resolution in meters, should fit allowed_resolution. More...
 
const interval allowed_resolution = std::make_pair(0.01f, 0.2f)
 The resolutions allowed by the spatial mapping.
allowed_resolution.first is the minimum value allowed.
allowed_resolution.seconf is the maximum value allowed. More...
 
float range_meter = 0.f
 Depth range in meters. Can be different from the value set by setDepthMaxRangeValue.
Is sets to 0 by default, in this case the range is computed from resolution_meter and from the currents inner parameters to fit your application. More...
 
const interval allowed_range = std::make_pair(2.f, 20.f)
 Range of the maximal depth value allowed by the spatial mapping.
allowed_range.first is the minimum value allowed.
allowed_range.seconf is the maximum value allowed. More...
 
bool save_texture = false
 Set to true if you want to be able to apply the texture to your mesh after its creation. More...
 
bool use_chunk_only = false
 Set to false if you want to keep consistency between the mesh and its inner chunks data. More...
 
int max_memory_usage = 2048
 The maximum CPU memory (in mega bytes) allocated for the meshing process. More...
 
bool reverse_vertex_order = false
 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. More...
 

Detailed Description

Sets the spatial mapping parameters.

A default constructor is enabled and set to its default parameters.
You can customize it to fit your application and then save it to create a preset that can be loaded for further executions.

Note
Parameters can be user adjusted.

Member Typedef Documentation

typedef std::pair<float, float> interval

Constructor and Destructor

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 
)

Default constructor, set all parameters to their default and optimized values.

Functions

static float get ( MAPPING_RESOLUTION  mapping_resolution = MAPPING_RESOLUTION_MEDIUM)
static

Return the resolution corresponding to the given RESOLUTION preset.

Parameters
resolution: the desired RESOLUTION. default : RESOLUTION_HIGH.
Returns
The resolution in meter.
void set ( MAPPING_RESOLUTION  mapping_resolution = MAPPING_RESOLUTION_MEDIUM)

Sets the resolution corresponding to the given RESOLUTION preset.

Parameters
resolution: the desired RESOLUTION. default :RESOLUTION_HIGH.
static float getRecommendedRange ( MAPPING_RESOLUTION  mapping_resolution,
Camera camera 
)
static

Return the recommanded maximum depth value for the given MAPPING_RESOLUTION preset.

Parameters
mapping_resolution: the desired MAPPING_RESOLUTION.
camera: the Camera object which will run the spatial mapping.
Returns
The maximum value of depth in meters.
static float getRecommendedRange ( float  resolution_meters,
Camera camera 
)
static

Return the recommanded maximum depth value for the given MAPPING_RESOLUTION preset.

Parameters
resolution: the desired resolution in meters.
camera: the Camera object which will run the spatial mapping.
Returns
The maximum value of depth in meters.
static float get ( MAPPING_RANGE  mapping_range = MAPPING_RANGE_MEDIUM)
static

Return the maximum value of depth corresponding to the given RANGE presets.

Parameters
range: the desired RANGE. default : RANGE_MEDIUM.
Returns
The maximum value of depth.
Deprecated:
Since SDK 2.6 range is computed from the requested resolution and inner parameters to best fit the current application
void set ( MAPPING_RANGE  mapping_range = MAPPING_RANGE_MEDIUM)

Sets the maximum value of depth corresponding to the given RANGE presets.

Parameters
range: the desired RANGE. default : RANGE_MEDIUM.
Deprecated:
Since SDK 2.6 range is computed from the requested resolution and inner parameters to best fit the current application
bool save ( String  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.
bool load ( String  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.

Variables

float resolution_meter = 0.05f

Spatial mapping resolution in meters, should fit allowed_resolution.

const interval allowed_resolution = std::make_pair(0.01f, 0.2f)

The resolutions allowed by the spatial mapping.
allowed_resolution.first is the minimum value allowed.
allowed_resolution.seconf is the maximum value allowed.

float range_meter = 0.f

Depth range in meters. Can be different from the value set by setDepthMaxRangeValue.
Is sets to 0 by default, in this case the range is computed from resolution_meter and from the currents inner parameters to fit your application.

Deprecated:
Since SDK 2.6 range is computed from the requested resolution and inner parameters to best fit the current application
const interval allowed_range = std::make_pair(2.f, 20.f)

Range of the maximal depth value allowed by the spatial mapping.
allowed_range.first is the minimum value allowed.
allowed_range.seconf is the maximum value allowed.

bool save_texture = false

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

Note
This option will take more memory.
bool use_chunk_only = false

Set to false if you want to keep consistency between the mesh and its inner chunks data.

Note
Updating the Mesh is time consuming, consider using only Chunks data for better performances.
int max_memory_usage = 2048

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

bool reverse_vertex_order = false

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.