InitParametersOne Class Reference

Class containing the options used to initialize the sl.CameraOne object. More...

Functions

RESOLUTION camera_resolution (self)
 Default constructor. More...
 
int camera_fps (self)
 Requested camera frame rate. More...
 
bool svo_real_time_mode (self)
 Defines if sl.Camera object return the frame in real time mode. More...
 
UNIT coordinate_units (self)
 Unit of spatial data (depth, point cloud, tracking, mesh, etc.) for retrieval. More...
 
COORDINATE_SYSTEM coordinate_system (self)
 sl.COORDINATE_SYSTEM to be used as reference for positional tracking, mesh, point clouds, etc. More...
 
int sdk_gpu_id (self)
 NVIDIA graphics card id to use. More...
 
int sdk_verbose (self)
 Enable the ZED SDK verbose mode. More...
 
str sdk_verbose_log_file (self)
 File path to store the ZED SDK logs (if sdk_verbose is enabled). More...
 
InputType input (self)
 The SDK can handle different input types: More...
 
str optional_settings_path (self)
 Optional path where the ZED SDK has to search for the settings file (SN<XXXX>.conf file). More...
 
bool async_grab_camera_recovery (self)
 Define the behavior of the automatic camera recovery during sl.Camera.grab() method call. More...
 
bool enable_hdr (self)
 Activates HDR support for the current resolution/mode. More...
 
None set_from_camera_id (self, uint, cam_id, BUS_TYPE bus_type=BUS_TYPE.AUTO)
 Defines the input source with a camera id to initialize and open an sl.CameraOne object from. More...
 
None set_from_serial_number (self, serial_number)
 Defines the input source with a serial number to initialize and open an sl.CameraOne object from. More...
 
None set_from_svo_file (self, str, svo_input_filename)
 Defines the input source with an SVO file to initialize and open an sl.CameraOne object from. More...
 
None set_from_stream (self, str, sender_ip, int, port=30000)
 Defines the input source from a stream to initialize and open an sl.CameraOne object from. More...
 

Detailed Description

Class containing the options used to initialize the sl.CameraOne 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.

import pyzed.sl as sl
def main() :
zed = sl.CameraOne() # Create a ZED camera object
init_params = sl.InitParametersOne() # Set initial parameters
init_params.sdk_verbose = 0 # Disable verbose mode
# Use the camera in LIVE mode
init_params.camera_resolution = sl.RESOLUTION.HD1080 # Use HD1080 video mode
init_params.camera_fps = 30 # Set fps at 30
# Or use the camera in SVO (offline) mode
#init_params.set_from_svo_file("xxxx.svo")
# Or use the camera in STREAM mode
#init_params.set_from_stream("192.168.1.12", 30000)
# Other parameters are left to their default values
# Open the camera
err = zed.open(init_params)
if err != sl.ERROR_CODE.SUCCESS:
exit(-1)
# Close the camera
zed.close()
return 0
if __name__ == "__main__" :
main()
Definition: sl.pyx:1

With its default values, it opens the camera in live mode at sl.RESOLUTION.HD720
You can customize it to fit your application.

Note
The parameters can also be saved and reloaded using its save() and load() methods.

Functions

◆ camera_resolution()

RESOLUTION camera_resolution (   self)

Default constructor.

All the parameters are set to their default and optimized values.

Parameters
camera_resolution: Chosen camera_resolution
camera_fps: Chosen camera_fps
svo_real_time_mode: Activates svo_real_time_mode
coordinate_units: Chosen coordinate_units
coordinate_system: Chosen coordinate_system
sdk_verbose: Sets sdk_verbose
sdk_verbose_log_file: Chosen sdk_verbose_log_file
input_t: Chosen input_t (InputType )
optional_settings_path: Chosen optional_settings_path
sensors_required: Activates sensors_required
optional_opencv_calibration_file: Sets optional_opencv_calibration_file
async_grab_camera_recovery: Sets async_grab_camera_recovery
enable_hdr: Sets enable_hdr
grab_compute_capping_fps: Sets grab_compute_capping_fps
enable_image_validity_check: Sets enable_image_validity_check

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: sl.RESOLUTION.AUTO

Note
Available resolutions are listed here: sl.RESOLUTION.

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ camera_fps()

int camera_fps (   self)

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.

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), CameraConfiguration.fps(), and CameraOneConfiguration.fps().

◆ svo_real_time_mode()

bool svo_real_time_mode (   self)

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

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

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), and InitLidarParameters.set_from_stream().

◆ coordinate_units()

UNIT coordinate_units (   self)

◆ coordinate_system()

COORDINATE_SYSTEM coordinate_system (   self)

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

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), InitFusionParameters.maximum_working_resolution(), InitLidarParameters.set_from_stream(), and InitSensorsParameters.sync_tolerance().

◆ sdk_gpu_id()

int sdk_gpu_id (   self)

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.CameraOne 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.

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), and InitSensorsParameters.sync_tolerance().

◆ sdk_verbose()

int sdk_verbose (   self)

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 messages enabled)

Note
The verbose messages can also be exported into a log file.
See sdk_verbose_log_file for more.

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), and InitLidarParameters.set_from_stream().

◆ sdk_verbose_log_file()

str sdk_verbose_log_file (   self)

File path to store the ZED SDK logs (if sdk_verbose is enabled).

The file will be created if it does not exist.
Default: ""

Note
Setting this parameter to any value will redirect all standard output print calls of the entire program.
This means that your own standard output print calls will be redirected to the log file.
Warning
The log file won't be cleared after successive executions of the application.
This means that it can grow indefinitely if not cleared.

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), and InitLidarParameters.set_from_stream().

◆ input()

InputType input (   self)

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

This parameter allows you to select to desired input. It should be used like this:

init_params = sl.InitParametersOne() # Set initial parameters
init_params.sdk_verbose = 1 # Enable verbose mode
input_t = sl.InputType()
input_t.set_from_camera_id(0) # Selects the camera with ID = 0
init_params.input = input_t
init_params.set_from_camera_id(0) # You can also use this
init_params = sl.InitParametersOne() # Set initial parameters
init_params.sdk_verbose = 1 # Enable verbose mode
input_t = sl.InputType()
input_t.set_from_serial_number(1010) # Selects the camera with serial number = 101
init_params.input = input_t
init_params.set_from_serial_number(1010) # You can also use this
init_params = sl.InitParametersOne() # Set initial parameters
init_params.sdk_verbose = 1 # Enable verbose mode
input_t = sl.InputType()
input_t.set_from_svo_file("/path/to/file.svo") # Selects the and SVO file to be read
init_params.input = input_t
init_params.set_from_svo_file("/path/to/file.svo") # You can also use this
init_params = sl.InitParametersOne() # Set initial parameters
init_params.sdk_verbose = 1 # Enable verbose mode
input_t = sl.InputType()
input_t.set_from_stream("192.168.1.42")
init_params.input = input_t
init_params.set_from_stream("192.168.1.42") # You can also use this

Available cameras and their ID/serial can be listed using get_device_list() and get_streaming_device_list() Each Camera will create its own memory (CPU and GPU), therefore the number of ZED used at the same time can be limited by the configuration of your computer. (GPU/CPU memory and capabilities)

default : empty See InputType for complementary information.

Warning
Using the ZED SDK Python API, using init_params.input.set_from_XXX won't work, use init_params.set_from_XXX instead

Referenced by InitLidarParameters.set_from_stream().

◆ optional_settings_path()

str optional_settings_path (   self)

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: ""

Note
The settings file will be searched in the default directory:
  • Linux: /usr/local/zed/settings/
  • Windows: C:/ProgramData/stereolabs/settings
If a path is specified and no file has been found, the ZED SDK will search the settings file in the default directory.
An automatic download of the settings file (through ZED Explorer or the installer) will still download the files on the default path.
init_params = sl.InitParametersOne() # Set initial parameters
home = "/path/to/home"
path = home + "/Documents/settings/" # assuming /path/to/home/Documents/settings/SNXXXX.conf exists. Otherwise, it will be searched in /usr/local/zed/settings/
init_params.optional_settings_path = path

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ async_grab_camera_recovery()

bool async_grab_camera_recovery (   self)

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

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ enable_hdr()

bool enable_hdr (   self)

Activates HDR support for the current resolution/mode.

Only active if the camera supports HDR for this resolution


Default: False

Referenced by InitParametersOne.enable_hdr().

◆ set_from_camera_id()

None set_from_camera_id (   self,
  uint,
  cam_id,
BUS_TYPE   bus_type = BUS_TYPE.AUTO 
)

Defines the input source with a camera id to initialize and open an sl.CameraOne object from.

Parameters
id: Id of the desired camera to open.
bus_type: sl.BUS_TYPE of the desired camera to open.

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ set_from_serial_number()

None set_from_serial_number (   self,
  serial_number 
)

Defines the input source with a serial number to initialize and open an sl.CameraOne object from.

For ZED/ZEDOne cameras (numeric serial numbers), pass an int or a numeric string. For Lidar sensors (string-based serial numbers like "991937000508"), pass a string.

Parameters
serial_number: Serial number of the desired camera/sensor to open (int or str).

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ set_from_svo_file()

None set_from_svo_file (   self,
  str,
  svo_input_filename 
)

Defines the input source with an SVO file to initialize and open an sl.CameraOne object from.

Parameters
svo_input_filename: Path to the desired SVO file to open.

Referenced by InitParameters.__cinit__(), and InitParametersOne.enable_hdr().

◆ set_from_stream()

None set_from_stream (   self,
  str,
  sender_ip,
  int,
  port = 30000 
)

Defines the input source from a stream to initialize and open an sl.CameraOne object from.

Parameters
sender_ip: IP address of the streaming sender.
port: Port on which to listen. Default: 30000

Referenced by InitParameters.__cinit__(), InitParametersOne.enable_hdr(), and InitLidarParameters.set_from_stream().