InitFusionParameters Class Reference

Holds the options used to initialize the Fusion object. More...

Functions

 InitFusionParameters (UNIT coordinate_units_=UNIT::MILLIMETER, COORDINATE_SYSTEM coordinate_system_=COORDINATE_SYSTEM::IMAGE, bool output_performance_metrics=true, int verbose_=0, unsigned timeout_period_number_=5, int sdk_gpu_id_=-1, CUcontext sdk_cuda_ctx_=CUcontext(), SynchronizationParameter synchronization_parameters_=SynchronizationParameter(), sl::Resolution maximum_working_resolution_=sl::Resolution(-1, -1))
 Default constructor. More...
 
bool save (String filename) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (String filename)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content) 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)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const InitFusionParameters &param1) const
 Comparison operator ==. More...
 
bool operator!= (const InitFusionParameters &param1) const
 Comparison operator !=. More...
 

Attributes

UNIT coordinate_units
 This parameter allows you to select the unit to be used for all metric values of the SDK (depth, point cloud, tracking, mesh, and others). More...
 
COORDINATE_SYSTEM coordinate_system
 Positional tracking, point clouds and many other features require a given COORDINATE_SYSTEM to be used as reference. This parameter allows you to select the COORDINATE_SYSTEM used by the Camera to return its measures. More...
 
bool output_performance_metrics
 It allows users to extract some stats of the Fusion API like drop frame of each camera, latency, etc... More...
 
int verbose
 Enable the verbosity mode of the SDK. More...
 
unsigned timeout_period_number
 If specified change the number of period necessary for a source to go in timeout without data. For example, if you set this to 5 then, if any source do not receive data during 5 period, these sources will go to timeout and will be ignored. More...
 
CUdevice sdk_gpu_id
 NVIDIA graphics card to use. More...
 
CUcontext sdk_cuda_ctx
 CUcontext to be used. More...
 
SynchronizationParameter synchronization_parameters
 Specifies the parameters used for data synchronization during fusion. More...
 
sl::Resolution maximum_working_resolution
 Sets the maximum resolution for all Fusion outputs, such as images and measures. More...
 

Detailed Description

Holds the options used to initialize the Fusion object.

Constructor and Destructor

◆ InitFusionParameters()

InitFusionParameters ( UNIT  coordinate_units_ = UNIT::MILLIMETER,
COORDINATE_SYSTEM  coordinate_system_ = COORDINATE_SYSTEM::IMAGE,
bool  output_performance_metrics = true,
int  verbose_ = 0,
unsigned  timeout_period_number_ = 5,
int  sdk_gpu_id_ = -1,
CUcontext  sdk_cuda_ctx_ = CUcontext(),
SynchronizationParameter  synchronization_parameters_ = SynchronizationParameter(),
sl::Resolution  maximum_working_resolution_ = sl::Resolution(-1, -1) 
)

Default constructor.

Functions

◆ save()

bool save ( String  filename) 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 '.json' 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)

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 '.json' 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) 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
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content)

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

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

◆ operator==()

bool operator== ( const InitFusionParameters param1) const

Comparison operator ==.

Parameters
param1to compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const InitFusionParameters param1) const

Comparison operator !=.

Parameters
param1to compare
Returns
true if the two struct are different

Variables

◆ coordinate_units

UNIT coordinate_units

This parameter allows you to select the unit to be used for all metric values of the SDK (depth, point cloud, tracking, mesh, and others).

Default : UNIT::MILLIMETER

◆ coordinate_system

COORDINATE_SYSTEM coordinate_system

Positional tracking, point clouds and many other features require a given COORDINATE_SYSTEM to be used as reference. This parameter allows you to select the COORDINATE_SYSTEM used by the Camera to return its measures.

This defines the order and the direction of the axis of the coordinate system.
Default : COORDINATE_SYSTEM::IMAGE

◆ output_performance_metrics

bool output_performance_metrics

It allows users to extract some stats of the Fusion API like drop frame of each camera, latency, etc...

◆ verbose

int verbose

Enable the verbosity mode of the SDK.

◆ timeout_period_number

unsigned timeout_period_number

If specified change the number of period necessary for a source to go in timeout without data. For example, if you set this to 5 then, if any source do not receive data during 5 period, these sources will go to timeout and will be ignored.

Note
This parameter is deprecated. Use data_source_timeout present in synchronization_parameters instead.

◆ sdk_gpu_id

CUdevice sdk_gpu_id

NVIDIA graphics card to use.

By default the SDK will use the most powerful NVIDIA graphics card found.
However, when running several applications, or using several cameras at the same time, splitting the load over available GPUs can be useful.
This parameter allows you to select the GPU used by the sl::Camera using an ID from 0 to n-1 GPUs in your PC.
Default: -1

Note
A non-positive value will search for all CUDA capable devices and select the most powerful.

◆ sdk_cuda_ctx

CUcontext sdk_cuda_ctx

CUcontext to be used.

If your application uses another CUDA-capable library, giving its CUDA context to the ZED SDK can be useful when sharing GPU memories.
This parameter allows you to set the CUDA context to be used by the ZED SDK.
Leaving this parameter empty asks the SDK to create its own context.
Default: (empty)

Note
When creating you own CUDA context, you have to define the device you will use. Do not forget to also specify it on sdk_gpu_id.
On Jetson, you have to set the flag CU_CTX_SCHED_YIELD, during CUDA context creation.
You can also let the SDK create its own context, and use sl::Camera::getCUDAContext() to use it.

◆ synchronization_parameters

SynchronizationParameter synchronization_parameters

Specifies the parameters used for data synchronization during fusion.

The SynchronizationParameter struct encapsulates the synchronization parameters that control the data fusion process.

◆ maximum_working_resolution

sl::Resolution maximum_working_resolution

Sets the maximum resolution for all Fusion outputs, such as images and measures.

The default value is (-1, -1), which allows the Fusion to automatically select the optimal resolution for the best quality/runtime ratio.

  • For images, the output resolution can be up to the native resolution of the camera.
  • For measures involving depth, the output resolution can be up to the maximum working resolution.

Setting this parameter to (-1, -1) will ensure the best balance between quality and performance for depth measures.