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_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...
 
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, uint, 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:

Note
Available resolutions are listed here: sl.RESOLUTION.

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

◆ coordinate_units()

UNIT coordinate_units (   self)

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

Default: sl.UNIT.MILLIMETER

◆ 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

◆ 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: 0 (no verbose message)

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

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

◆ 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

◆ 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

◆ 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

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

◆ set_from_serial_number()

None set_from_serial_number (   self,
  uint,
  serial_number 
)

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

Parameters
serial_number: Serial number of the desired camera to open.

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

◆ 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