Class containing the options used to initialize the sl::Camera object. More...
Functions | |
InitParameters (RESOLUTION camera_resolution_=RESOLUTION::AUTO, int camera_fps_=0, bool svo_real_time_mode_=false, DEPTH_MODE depth_mode_=DEPTH_MODE::ULTRA, UNIT coordinate_units_=UNIT::MILLIMETER, COORDINATE_SYSTEM coordinate_system_=COORDINATE_SYSTEM::IMAGE, int sdk_verbose_=1, int sdk_gpu_id_=-1, float depth_minimum_distance_=-1., float depth_maximum_distance_=-1., bool camera_disable_self_calib_=false, int camera_image_flip_=FLIP_MODE::OFF, bool enable_right_side_measure_=false, String sdk_verbose_log_file_=String(), int depth_stabilization_=1, CUcontext sdk_cuda_ctx_=CUcontext(), InputType input_type=InputType(), String optional_settings_path_=String(), bool sensors_required_=false, bool enable_image_enhancement_=true, String optional_opencv_calibration_file_=String(), float open_timeout_sec_=5.0f, bool async_grab_camera_recovery=false, float grab_compute_capping_fps=0, int enable_image_validity_check=false, bool async_image_retrieval=false) | |
Default constructor. 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 InitParameters ¶m1) const |
Comparison operator ==. More... | |
bool | operator!= (const InitParameters ¶m1) const |
Comparison operator !=. More... | |
Attributes | |
RESOLUTION | camera_resolution |
Desired camera resolution. More... | |
int | camera_fps |
Requested camera frame rate. More... | |
int | 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 sl::Camera object return the frame in real time mode. More... | |
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_units. More... | |
float | depth_maximum_distance |
Maximum depth distance to be returned, measured in the sl::UNIT defined in coordinate_units. More... | |
UNIT | coordinate_units |
Unit of spatial data (depth, point cloud, tracking, mesh, etc.) for retrieval. More... | |
COORDINATE_SYSTEM | coordinate_system |
sl::COORDINATE_SYSTEM to be used as reference for positional tracking, mesh, point clouds, etc. More... | |
CUdevice | sdk_gpu_id |
NVIDIA graphics card to use. More... | |
int | sdk_verbose |
Enable the ZED SDK verbose mode. More... | |
String | sdk_verbose_log_file |
File path to store the ZED SDK logs (if sdk_verbose is enabled). More... | |
CUcontext | sdk_cuda_ctx |
CUcontext to be used. More... | |
InputType | input |
Defines the input source to initialize and open an sl::Camera object from. More... | |
String | optional_settings_path |
Optional path where the ZED SDK has to search for the settings file (SN<XXXX>.conf file). More... | |
String | optional_opencv_calibration_file |
Optional path where the ZED SDK can find a file containing the calibration information of the camera computed by OpenCV. 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::Camera::open() method fails. More... | |
bool | async_grab_camera_recovery |
Define the behavior of the automatic camera recovery during sl::Camera::grab() method call. More... | |
float | grab_compute_capping_fps |
Define a computation upper limit to the grab frequency. More... | |
bool | async_image_retrieval |
If set to true will camera image retrieve at a framerate different from grab() application framerate. This is useful for recording SVO or sending camera stream at different rate than application. More... | |
int | enable_image_validity_check |
Enable or disable the image validity verification. More... | |
Class containing the options used to initialize the sl::Camera object.
This class allows you to select multiple parameters for the sl::Camera 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::Camera.open() method.
With its default values, it opens the camera in live mode at sl::RESOLUTION::HD720 (or sl::RESOLUTION::HD1200 for the ZED X/X Mini) and sets the depth mode to sl::DEPTH_MODE::ULTRA (or sl::DEPTH_MODE::PERFORMANCE on Jetson).
You can customize it to fit your application.
InitParameters | ( | RESOLUTION | camera_resolution_ = RESOLUTION::AUTO , |
int | camera_fps_ = 0 , |
||
bool | svo_real_time_mode_ = false , |
||
DEPTH_MODE | depth_mode_ = DEPTH_MODE::ULTRA , |
||
UNIT | coordinate_units_ = UNIT::MILLIMETER , |
||
COORDINATE_SYSTEM | coordinate_system_ = COORDINATE_SYSTEM::IMAGE , |
||
int | sdk_verbose_ = 1 , |
||
int | sdk_gpu_id_ = -1 , |
||
float | depth_minimum_distance_ = -1. , |
||
float | depth_maximum_distance_ = -1. , |
||
bool | camera_disable_self_calib_ = false , |
||
int | camera_image_flip_ = FLIP_MODE::OFF , |
||
bool | enable_right_side_measure_ = false , |
||
String | sdk_verbose_log_file_ = String() , |
||
int | depth_stabilization_ = 1 , |
||
CUcontext | sdk_cuda_ctx_ = CUcontext() , |
||
InputType | input_type = InputType() , |
||
String | optional_settings_path_ = String() , |
||
bool | sensors_required_ = false , |
||
bool | enable_image_enhancement_ = true , |
||
String | optional_opencv_calibration_file_ = String() , |
||
float | open_timeout_sec_ = 5.0f , |
||
bool | async_grab_camera_recovery = false , |
||
float | grab_compute_capping_fps = 0 , |
||
int | enable_image_validity_check = false , |
||
bool | async_image_retrieval = false |
||
) |
Default constructor.
All the parameters are set to their default and optimized values.
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 set). |
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 InitParameters & | param1 | ) | const |
Comparison operator ==.
InitParameters | to compare |
bool operator!= | ( | const InitParameters & | param1 | ) | const |
Comparison operator !=.
InitParameters | to compare |
RESOLUTION camera_resolution |
Desired camera resolution.
Default:
int 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.
int 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::AUTO
bool camera_disable_self_calib |
Disables the self-calibration process at camera opening.
At initialization, sl::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
bool 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
bool svo_real_time_mode |
Defines if sl::Camera object return the frame in real time mode.
When playing back an SVO file, each call to sl::Camera::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
DEPTH_MODE 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
int 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]:
Default: 1
float depth_minimum_distance |
Minimum depth distance to be returned, measured in the sl::UNIT defined in coordinate_units.
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)
float depth_maximum_distance |
Maximum depth distance to be returned, measured in the sl::UNIT defined in coordinate_units.
When estimating the depth, the ZED SDK uses this upper limit to turn higher values into sl::TOO_FAR ones.
UNIT coordinate_units |
Unit of spatial data (depth, point cloud, tracking, mesh, etc.) for retrieval.
Default: sl::UNIT::MILLIMETER
COORDINATE_SYSTEM 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 sl::Camera object to return its measures.
This defines the order and the direction of the axis of the coordinate system.
Default: sl::COORDINATE_SYSTEM::IMAGE
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
int 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: 1 (verbose message enabled)
String sdk_verbose_log_file |
File path to store the ZED SDK logs (if sdk_verbose is enabled).
The file will be created if it does not exist.
Default: ""
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)
InputType input |
Defines the input source to initialize and open an sl::Camera object from.
The SDK can handle different input types:
Default : (empty)
String optional_settings_path |
Optional path where the ZED SDK has to search for the settings file (SN<XXXX>.conf file).
This file contains the calibration information of the camera.
Default: ""
String optional_opencv_calibration_file |
Optional path where the ZED SDK can find a file containing the calibration information of the camera computed by OpenCV.
bool sensors_required |
Requires the successful opening of the motion sensors before opening the camera.
Default: false.
This can be used for example when using a USB3.0 only extension cable (some fiber extension for example).
bool 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.
float open_timeout_sec |
Define a timeout in seconds after which an error is reported if the sl::Camera::open() method 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
bool async_grab_camera_recovery |
Define the behavior of the automatic camera recovery during sl::Camera::grab() method call.
When async is enabled and there's an issue with the communication with the sl::Camera object, sl::Camera::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::Camera::grab() method is blocking and will return only once the camera communication is restored or the timeout is reached.
Default: false
float 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.
This is an upper limit and won't make a difference if the computation is slower than the desired compute capping FPS.
bool async_image_retrieval |
If set to true will camera image retrieve at a framerate different from grab() application framerate. This is useful for recording SVO or sending camera stream at different rate than application.
int 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 sl::Camera.grab() method and requires some computations.
If an issue is found, the sl::Camera.grab() method will output a warning as sl::ERROR_CODE::CORRUPTED_FRAME.
This version doesn't detect frame tearing currently.
Default: false (disabled)