SL_InitParameters Struct Reference

Structure containing the options used to initialize a camera. More...

Data Fields

enum SL_INPUT_TYPE input_type
 Defines the input source to initialize and open an camera from. More...
 
enum SL_RESOLUTION resolution
 Desired camera resolution. More...
 
int camera_fps
 Requested camera frame rate. More...
 
int camera_device_id
 Id for identifying which camera to use from the connected cameras.
 
enum SL_FLIP_MODE camera_image_flip
 Defines if a flip of the images is needed. More...
 
bool camera_disable_self_calib
 Disables the self-calibration process at camera opening. More...
 
bool enable_right_side_measure
 Enable the measurement computation on the right images. More...
 
bool svo_real_time_mode
 Defines if the camera return the frame in real time mode. More...
 
enum SL_DEPTH_MODE depth_mode
 SL_DEPTH_MODE to be used. More...
 
int depth_stabilization
 Defines whether the depth needs to be stabilized and to what extent. More...
 
float depth_minimum_distance
 Minimum depth distance to be returned, measured in the SL_UNIT defined in coordinate_unit. More...
 
float depth_maximum_distance
 Maximum depth distance to be returned, measured in the SL_UNIT defined in coordinate_unit. More...
 
enum SL_UNIT coordinate_unit
 Unit of spatial data (depth, point cloud, tracking, mesh, etc.) for retrieval. More...
 
enum SL_COORDINATE_SYSTEM coordinate_system
 SL_COORDINATE_SYSTEM to be used as reference for positional tracking, mesh, point clouds, etc. More...
 
int sdk_gpu_id
 NVIDIA graphics card id to use. More...
 
int sdk_verbose
 Enable the ZED SDK verbose mode. More...
 
bool sensors_required
 Requires the successful opening of the motion sensors before opening the camera. More...
 
bool enable_image_enhancement
 Enable the Enhanced Contrast Technology, to improve image quality. More...
 
float open_timeout_sec
 Define a timeout in seconds after which an error is reported if the sl_open_camera() function fails. More...
 
bool async_grab_camera_recovery
 Define the behavior of the automatic camera recovery during sl_grab() function call. More...
 
float grab_compute_capping_fps
 Define a computation upper limit to the grab frequency. More...
 
bool enable_image_validity_check
 

Detailed Description

Structure containing the options used to initialize a camera.

This class allows you to select multiple parameters for the camera to open such as the selected camera, resolution, depth mode, coordinate system, and units of measurement.
Once filled with the desired options, it should be passed to the sl_open_camera() function.

Note
For more info, read about the ZED SDK C++ class it mirrors: InitParameters

Field Documentation

◆ input_type

enum SL_INPUT_TYPE SL_InitParameters::input_type

Defines the input source to initialize and open an camera from.

The SDK can handle different input types:

  • Select a camera by its ID (/dev/videoX on Linux, and 0 to N cameras connected on Windows)
  • Select a camera by its serial number
  • Open a recorded sequence in the SVO file format
  • Open a streaming camera from its IP address and port
Note
Available cameras and their id/serial number can be listed using sl_get_device_list() and sl_get_streaming_device_list().
Each camera will create its own memory (CPU and GPU), therefore the number of cameras used at the same time can be limited by the configuration of your computer (GPU/CPU memory and capabilities).

Default : (empty)

Note
See SL_INPUT_TYPE for complementary information.

◆ resolution

enum SL_RESOLUTION SL_InitParameters::resolution

Desired camera resolution.

Note
Small resolutions offer higher framerate and lower computation time.
In most situations, SL_RESOLUTION_HD720 at 60 FPS is the best balance between image quality and framerate.

Default:

Note
Available resolutions are listed here: SL_RESOLUTION.

◆ camera_fps

int SL_InitParameters::camera_fps

Requested camera frame rate.

If set to 0, the highest FPS of the specified camera_resolution will be used.
Default: 0

See SL_RESOLUTION for a list of supported frame rates.

Note
If the requested camera_fps is unsupported, the closest available FPS will be used.

◆ camera_image_flip

enum SL_FLIP_MODE SL_InitParameters::camera_image_flip

Defines if a flip of the images is needed.

If you are using the camera upside down, setting this parameter to SL_FLIP_MODE_ON will cancel its rotation.
The images will be horizontally flipped.
Default: SL_FLIP_MODE_OFF

Note
From ZED SDK 3.2 a new SL_FLIP_MODE enum was introduced to add the automatic flip mode detection based on the IMU gravity detection.
This does not work on SL_MODEL_ZED cameras since they do not have the necessary sensors.

◆ camera_disable_self_calib

bool SL_InitParameters::camera_disable_self_calib

Disables the self-calibration process at camera opening.

At initialization, sl_open_camera() runs a self-calibration process that corrects small offsets from the device's factory calibration.
A drawback is that calibration parameters will slightly change from one (live) run to another, which can be an issue for repeatability.
If set to true, self-calibration will be disabled and calibration parameters won't be optimized, raw calibration parameters from the configuration file will be used.
Default: false

Note
In most situations, self calibration should remain enabled.
You can also trigger the self-calibration at anytime after sl_open_camera() by calling sl_update_self_calibration(), even if this parameter is set to true.

◆ enable_right_side_measure

bool SL_InitParameters::enable_right_side_measure

Enable the measurement computation on the right images.

By default, the ZED SDK only computes a single depth map, aligned with the left camera image.
This parameter allows you to enable SL_MEASURE_DEPTH_RIGHT and other SL_MEASURE_XXX_RIGHT at the cost of additional computation time.
For example, mixed reality pass-through applications require one depth map per eye, so this parameter can be activated.
Default: false

◆ svo_real_time_mode

bool SL_InitParameters::svo_real_time_mode

Defines if the camera return the frame in real time mode.

When playing back an SVO file, each call to sl_grab() will extract a new frame and use it.
However, it ignores the real capture rate of the images saved in the SVO file.
Enabling this parameter will bring the SDK closer to a real simulation when playing back a file by using the images' timestamps.
Default: false

Note
sl_grab() will return an error when trying to play too fast, and frames will be dropped when playing too slowly.

◆ depth_mode

enum SL_DEPTH_MODE SL_InitParameters::depth_mode

SL_DEPTH_MODE to be used.

The ZED SDK offers several SL_DEPTH_MODE, offering various levels of performance and accuracy.
This parameter allows you to set the SL_DEPTH_MODE that best matches your needs.
Default: SL_DEPTH_MODE_PERFORMANCE

Note
Available depth mode are listed here: SL_DEPTH_MODE.

◆ depth_stabilization

int SL_InitParameters::depth_stabilization

Defines whether the depth needs to be stabilized and to what extent.

Regions of generated depth map can oscillate from one frame to another.
These oscillations result from a lack of texture (too homogeneous) on an object and by image noise.
This parameter controls a stabilization filter that reduces these oscillations.
In the range [0-100]:

  • 0 disable the depth stabilization (raw depth will be return)
  • stabilization smoothness is linear from 1 to 100

Default: 1

Note
The stabilization uses the positional tracking to increase its accuracy, so the positional tracking module will be enabled automatically when set to a value different from 0.
Note that calling sl_enable_positional_tracking() with your own parameters afterwards is still possible.

◆ depth_minimum_distance

float SL_InitParameters::depth_minimum_distance

Minimum depth distance to be returned, measured in the SL_UNIT defined in coordinate_unit.

This parameter allows you to specify the minimum depth value (from the camera) that will be computed.


In stereovision (the depth technology used by the camera), looking for closer depth values can have a slight impact on performance and memory consumption.
On most modern GPUs, performance impact will be low. However, the impact of memory footprint will be visible.
In cases of limited computation power, increasing this value can provide better performance.
Default: -1 (corresponding values are available here)

Note
depth_minimum_distance value cannot be greater than 3 meters.
0 will imply that depth_minimum_distance is set to the minimum depth possible for each camera (those values are available here).

◆ depth_maximum_distance

float SL_InitParameters::depth_maximum_distance

Maximum depth distance to be returned, measured in the SL_UNIT defined in coordinate_unit.

When estimating the depth, the ZED SDK uses this upper limit to turn higher values into inf ones.

Note
Changing this value has no impact on performance and doesn't affect the positional tracking nor the spatial mapping.
It only change values the depth, point cloud and normals.

◆ coordinate_unit

enum SL_UNIT SL_InitParameters::coordinate_unit

Unit of spatial data (depth, point cloud, tracking, mesh, etc.) for retrieval.

Default: SL_UNIT_MILLIMETER

◆ coordinate_system

enum SL_COORDINATE_SYSTEM SL_InitParameters::coordinate_system

SL_COORDINATE_SYSTEM to be used as reference for positional tracking, mesh, point clouds, etc.

This parameter allows you to select the SL_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: SL_COORDINATE_SYSTEM_IMAGE

◆ sdk_gpu_id

int SL_InitParameters::sdk_gpu_id

NVIDIA graphics card id 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_verbose

int SL_InitParameters::sdk_verbose

Enable the ZED SDK verbose mode.

This parameter allows you to enable the verbosity of the ZED SDK to get a variety of runtime information in the console.
When developing an application, enabling verbose (sdk_verbose >= 1) mode can help you understand the current ZED SDK behavior.
However, this might not be desirable in a shipped version.
Default: 0 (no verbose message)

Note
The verbose messages can also be exported into a log file.

◆ sensors_required

bool SL_InitParameters::sensors_required

Requires the successful opening of the motion sensors before opening the camera.

Default: false.

Note
If set to false, the ZED SDK will try to open and use the IMU (second USB device on USB2.0) and will open the camera successfully even if the sensors failed to open.

This can be used for example when using a USB3.0 only extension cable (some fiber extension for example).

Note
This parameter only impacts the LIVE mode.
If set to true, sl_open_camera() will fail if the sensors cannot be opened.
This parameter should be used when the IMU data must be available, such as object detection module or when the gravity is needed.


Note
This setting is not taken into account for SL_MODEL_ZED camera since it does not include sensors.

◆ enable_image_enhancement

bool SL_InitParameters::enable_image_enhancement

Enable the Enhanced Contrast Technology, to improve image quality.

Default: true.


If set to true, image enhancement will be activated in camera ISP. Otherwise, the image will not be enhanced by the IPS.

Note
This only works for firmware version starting from 1523 and up.

◆ open_timeout_sec

float SL_InitParameters::open_timeout_sec

Define a timeout in seconds after which an error is reported if the sl_open_camera() function fails.

Set to '-1' to try to open the camera endlessly without returning error in case of failure.
Set to '0' to return error in case of failure at the first attempt.
Default: 5.0

Note
This parameter only impacts the LIVE mode.

◆ async_grab_camera_recovery

bool SL_InitParameters::async_grab_camera_recovery

Define the behavior of the automatic camera recovery during sl_grab() function call.

When async is enabled and there's an issue with the communication with the camera, sl_grab() will exit after a short period and return the SL_ERROR_CODE_CAMERA_REBOOTING warning.
The recovery will run in the background until the correct communication is restored.
When async_grab_camera_recovery is false, the sl_grab() function is blocking and will return only once the camera communication is restored or the timeout is reached.
Default: false

◆ grab_compute_capping_fps

float SL_InitParameters::grab_compute_capping_fps

Define a computation upper limit to the grab frequency.

This can be useful to get a known constant fixed rate or limit the computation load while keeping a short exposure time by setting a high camera capture framerate.
The value should be inferior to the SL_InitParameters::camera_fps and strictly positive.

Note
It has no effect when reading an SVO file.

This is an upper limit and won't make a difference if the computation is slower than the desired compute capping FPS.

Note
Internally the sl_grab() function always tries to get the latest available image while respecting the desired FPS as much as possible.

◆ enable_image_validity_check

bool SL_InitParameters::enable_image_validity_check

Enable or disable the image validity verification. This will perform additional verification on the image to identify corrupted data. This verification is done in the grab function and requires some computations. If an issue is found, the grab function will output a warning as sl::ERROR_CODE::CORRUPTED_FRAME. This version doesn't detect frame tearing currently.
default: disabled