This class is the main interface with the camera and the SDK features, such as: video, depth, tracking, mapping, and more. More...
Functions | |
def | close (self) |
If open() has been called, this function will close the connection to the camera (or the SVO file) and free the corresponding memory. More... | |
def | open (self, py_init=InitParameters()) |
Opens the ZED camera from the provided InitParameters. More... | |
def | is_opened (self) |
Reports if the camera has been successfully opened. More... | |
def | grab (self, py_runtime=RuntimeParameters()) |
This function will grab the latest images from the camera, rectify them, and compute the measurements based on the RuntimeParameters provided (depth, point cloud, tracking, etc.) As measures are created in this function, its execution can last a few milliseconds, depending on your parameters and your hardware. More... | |
def | retrieve_image (self, Mat py_mat, view=VIEW.LEFT, type=MEM.CPU, resolution=Resolution(0, 0)) |
Retrieves images from the camera (or SVO file). More... | |
def | retrieve_measure (self, Mat py_mat, measure=MEASURE.DEPTH, type=MEM.CPU, resolution=Resolution(0, 0)) |
Computed measures, like depth, point cloud, or normals, can be retrieved using this method. More... | |
def | set_region_of_interest (self, Mat py_mat) |
Defines a region of interest to focus on for all the SDK, discarding other parts. More... | |
def | set_svo_position (self, int frame_number) |
Sets the playback cursor to the desired frame number in the SVO file. More... | |
def | get_svo_position (self) |
Returns the current playback position in the SVO file. More... | |
def | get_svo_number_of_frames (self) |
Returns the number of frames in the SVO file. More... | |
def | set_camera_settings (self, VIDEO_SETTINGS settings, value=-1) |
Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.) More... | |
def | set_camera_settings_roi (self, VIDEO_SETTINGS settings, Rect roi, eye=SIDE.BOTH, reset=False) |
Sets the ROI of the requested camera setting (AEC_AGC_ROI) More... | |
def | get_camera_settings (self, VIDEO_SETTINGS setting) |
Returns the current value of the requested camera setting. More... | |
def | get_camera_settings_roi (self, VIDEO_SETTINGS setting, Rect roi, eye=SIDE.BOTH) |
Returns the current value of the currently used ROI for the camera setting (AEC_AGC_ROI) More... | |
def | get_current_fps (self) |
Returns the current framerate at which the grab() method is successfully called. More... | |
def | get_timestamp (self, TIME_REFERENCE time_reference) |
Returns the timestamp in the requested TIME_REFERENCE. More... | |
def | get_frame_dropped_count (self) |
Returns the number of frames dropped since grab() was called for the first time. More... | |
def | get_current_min_max_depth (self, float min, float max) |
Gets the current range of perceived depth. | |
def | get_camera_information (self, resizer=Resolution(0, 0)) |
Returns the calibration parameters, serial number and other information about the camera being used. More... | |
def | get_runtime_parameters (self) |
Returns the runtime parameters used. More... | |
def | get_init_parameters (self) |
Returns the init parameters used. More... | |
def | get_positional_tracking_parameters (self) |
Returns the positional tracking parameters used. More... | |
def | get_spatial_mapping_parameters (self) |
Returns the spatial mapping parameters used. More... | |
def | get_object_detection_parameters (self) |
Returns the object detection parameters used. More... | |
def | get_streaming_parameters (self) |
Returns the streaming parameters used. More... | |
def | enable_positional_tracking (self, py_tracking=PositionalTrackingParameters()) |
Initializes and starts the positional tracking processes. More... | |
def | update_self_calibration (self) |
Performs a new self calibration process. More... | |
def | get_sensors_data (self, SensorsData py_sensors_data, time_reference=TIME_REFERENCE.CURRENT) |
Retrieves the Sensors (IMU,magnetometer,barometer) Data at a specific time reference. More... | |
def | set_imu_prior (self, Transform transfom) |
Set an optional IMU orientation hint that will be used to assist the tracking during the next grab(). More... | |
def | get_position (self, Pose py_pose, reference_frame=REFERENCE_FRAME.WORLD) |
Retrieves the estimated position and orientation of the camera in the specified reference frame. More... | |
def | get_area_export_state (self) |
Returns the state of the spatial memory export process. More... | |
def | save_area_map (self, area_file_path="") |
Saves the current area learning file. More... | |
def | disable_positional_tracking (self, area_file_path="") |
Disables the positional tracking. More... | |
def | is_positional_tracking_enabled (self) |
Tells if the tracking module is enabled. | |
def | reset_positional_tracking (self, Transform path) |
Resets the tracking, and re-initializes the position with the given transformation matrix. More... | |
def | enable_spatial_mapping (self, py_spatial=SpatialMappingParameters()) |
Initializes and starts the spatial mapping processes. More... | |
def | pause_spatial_mapping (self, bool status) |
Pauses or resumes the spatial mapping processes. More... | |
def | get_spatial_mapping_state (self) |
Returns the current spatial mapping state. More... | |
def | request_spatial_map_async (self) |
Starts the spatial map generation process in a non blocking thread from the spatial mapping process. More... | |
def | get_spatial_map_request_status_async (self) |
Returns the spatial map generation status. More... | |
def | retrieve_spatial_map_async (self, py_mesh) |
Retrieves the current generated spatial map. More... | |
def | extract_whole_spatial_map (self, py_mesh) |
Extracts the current spatial map from the spatial mapping process. More... | |
def | find_plane_at_hit (self, coord, Plane py_plane) |
Checks the plane at the given left image coordinates. More... | |
def | find_floor_plane (self, Plane py_plane, Transform resetTrackingFloorFrame, floor_height_prior=float('nan'), world_orientation_prior=Rotation(Matrix3f().zeros()), floor_height_prior_tolerance=float('nan')) |
Detect the floor plane of the scene. More... | |
def | disable_spatial_mapping (self) |
Disables the spatial mapping process. More... | |
def | enable_streaming (self, streaming_parameters=StreamingParameters()) |
Creates a streaming pipeline for images. More... | |
def | disable_streaming (self) |
Disables the streaming initiated by enable_straming() More... | |
def | is_streaming_enabled (self) |
Tells if the streaming is actually sending data (true) or still in configuration (false) | |
def | enable_recording (self, RecordingParameters record) |
Creates an SVO file to be filled by record(). More... | |
def | disable_recording (self) |
Disables the recording initiated by enable_recording() and closes the generated file. More... | |
def | get_recording_status (self) |
Get the recording information. More... | |
def | pause_recording (self, value=True) |
Pauses or resumes the recording. More... | |
def | get_recording_parameters (self) |
Returns the recording parameters used. More... | |
def | enable_object_detection (self, object_detection_parameters=ObjectDetectionParameters()) |
Initializes and starts the object detection module. More... | |
def | disable_object_detection (self) |
Disables the Object Detection process. More... | |
def | pause_object_detection (self, bool status) |
Pauses or resumes the object detection processes. More... | |
def | retrieve_objects (self, Objects py_objects, object_detection_parameters=ObjectDetectionRuntimeParameters()) |
Retrieve objects detected by the object detection module. More... | |
def | get_objects_batch (self, list[ObjectsBatch] trajectories) |
Get a batch of detected objects. More... | |
def | ingest_custom_box_objects (self, list[CustomBoxObjectData] objects_in) |
Feed the 3D Object tracking function with your own 2D bounding boxes from your own detection algorithm. More... | |
Static Functions | |
def | get_sdk_version () |
Returns the version of the currently installed ZED SDK. | |
def | get_device_list () |
Lists all the connected devices with their associated information. More... | |
def | get_streaming_device_list () |
Lists all the streaming devices with their associated information. More... | |
def | reboot (int sn, bool fullReboot=True) |
Performs an hardware reset of the ZED 2. More... | |
This class is the main interface with the camera and the SDK features, such as: video, depth, tracking, mapping, and more.
Find more information in the detailed description below.
A standard program will use the Camera class like this:
def close | ( | self | ) |
If open() has been called, this function will close the connection to the camera (or the SVO file) and free the corresponding memory.
If open() wasn't called or failed, this function won't have any effect.
def open | ( | self, | |
py_init = InitParameters() |
|||
) |
Opens the ZED camera from the provided InitParameters.
This function will also check the hardware requirements and run a self-calibration.
py_init | : a structure containing all the initial parameters. default : a preset of InitParameters. |
Here is the proper way to call this function:
def is_opened | ( | self | ) |
def grab | ( | self, | |
py_runtime = RuntimeParameters() |
|||
) |
This function will grab the latest images from the camera, rectify them, and compute the measurements based on the RuntimeParameters provided (depth, point cloud, tracking, etc.) As measures are created in this function, its execution can last a few milliseconds, depending on your parameters and your hardware.
The exact duration will mostly depend on the following parameters:
This function is meant to be called frequently in the main loop of your application.
py_runtime | : a structure containing all the runtime parameters. default : a preset of RuntimeParameters. |
Returning | SUCCESS means that no problem was encountered. Returned errors can be displayed using toString(error) |
def retrieve_image | ( | self, | |
Mat | py_mat, | ||
view = VIEW.LEFT , |
|||
type = MEM.CPU , |
|||
resolution = Resolution(0,0) |
|||
) |
Retrieves images from the camera (or SVO file).
Multiple images are available along with a view of various measures for display purposes. Available images and views are listed here. As an example, VIEW.DEPTH can be used to get a gray-scale version of the depth map, but the actual depth values can be retrieved using retrieve_measure() .
Memory
By default, images are copied from GPU memory to CPU memory (RAM) when this function is called. If your application can use GPU images, using the type parameter can increase performance by avoiding this copy. If the provided Mat object is already allocated and matches the requested image format, memory won't be re-allocated.
Image size
By default, images are returned in the resolution provided by get_camera_information() in CameraInformation.camera_resolution However, you can request custom resolutions. For example, requesting a smaller image can help you speed up your application.
py_mat | : [out] the Mat to store the image. |
view | : defines the image you want (see VIEW). default : VIEW.LEFT. |
type | : defines on which memory the image should be allocated. default : MEM.CPU (you cannot change this default value) |
resolution | : if specified, defines the Resolution of the output mat. If set to (0,0) , the ZED resolution will be taken. default : (0,0). |
def retrieve_measure | ( | self, | |
Mat | py_mat, | ||
measure = MEASURE.DEPTH , |
|||
type = MEM.CPU , |
|||
resolution = Resolution(0,0) |
|||
) |
Computed measures, like depth, point cloud, or normals, can be retrieved using this method.
Multiple measures are available after a Camera.grab() call. A full list is available here.
Memory By default, images are copied from GPU memory to CPU memory (RAM) when this function is called. If your application can use GPU images, using the type parameter can increase performance by avoiding this copy. If the provided Mat object is already allocated and matches the requested image format, memory won't be re-allocated.
Measure size By default, measures are returned in the resolution provided by get_camera_information() in CameraInformations.camera_resolution . However, custom resolutions can be requested. For example, requesting a smaller measure can help you speed up your application.
py_mat | : [out] the Mat to store the measures |
measure | : defines the measure you want. (see MEASURE), default : MEASURE.DEPTH |
type | : defines on which memory the mat should be allocated. default : MEM.CPU (you cannot change this default value) |
resolution | : if specified, defines the resolution of the output mat. If set to Resolution (0,0) , the ZED resolution will be taken. default : (0,0). |
def set_region_of_interest | ( | self, | |
Mat | py_mat | ||
) |
Defines a region of interest to focus on for all the SDK, discarding other parts.
roi_mask | the Mat defining the requested region of interest, all pixel set to 0 will be discard. If empty, set all pixels as valid, otherwise should fit the resolution of the current instance and its type should be U8_C1. |
def set_svo_position | ( | self, | |
int | frame_number | ||
) |
Sets the playback cursor to the desired frame number in the SVO file.
This function allows you to move around within a played-back SVO file. After calling, the next call to grab() will read the provided frame number.
frame_number | : the number of the desired frame to be decoded. |
def get_svo_position | ( | self | ) |
Returns the current playback position in the SVO file.
The position corresponds to the number of frames already read from the SVO file, starting from 0 to n.
Each grab() call increases this value by one (except when using InitParameters.svo_real_time_mode).
See set_svo_position() for an example.
def get_svo_number_of_frames | ( | self | ) |
Returns the number of frames in the SVO file.
def set_camera_settings | ( | self, | |
VIDEO_SETTINGS | settings, | ||
value = -1 |
|||
) |
Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.)
Possible values (range) of each setting are available here.
settings | : the setting to be set |
value | : the value to set, default : auto mode |
def set_camera_settings_roi | ( | self, | |
VIDEO_SETTINGS | settings, | ||
Rect | roi, | ||
eye = SIDE.BOTH , |
|||
reset = False |
|||
) |
Sets the ROI of the requested camera setting (AEC_AGC_ROI)
settings | : the setting to be set |
roi | : the requested ROI |
eye | : the requested side. Default: SIDE.BOTH |
reset | : cancel the manual ROI and reset it to the full image. Default: False |
def get_camera_settings | ( | self, | |
VIDEO_SETTINGS | setting | ||
) |
Returns the current value of the requested camera setting.
(gain, brightness, hue, exposure, etc.)
Possible values (range) of each setting are available here.
setting | : the requested setting. |
def get_camera_settings_roi | ( | self, | |
VIDEO_SETTINGS | setting, | ||
Rect | roi, | ||
eye = SIDE.BOTH |
|||
) |
Returns the current value of the currently used ROI for the camera setting (AEC_AGC_ROI)
setting | : the requested setting. |
roi | : the current ROI used |
eye | : the requested side. Default: SIDE.BOTH |
def get_current_fps | ( | self | ) |
Returns the current framerate at which the grab() method is successfully called.
The returned value is based on the difference of camera timestamps between two successful grab() calls.
def get_timestamp | ( | self, | |
TIME_REFERENCE | time_reference | ||
) |
Returns the timestamp in the requested TIME_REFERENCE.
This function can also be used when playing back an SVO file.
time_reference | : The selected TIME_REFERENCE. |
def get_frame_dropped_count | ( | self | ) |
Returns the number of frames dropped since grab() was called for the first time.
A dropped frame corresponds to a frame that never made it to the grab function. This can happen if two frames were extracted from the camera when grab() is called. The older frame will be dropped so as to always use the latest (which minimizes latency)
def get_camera_information | ( | self, | |
resizer = Resolution(0, 0) |
|||
) |
Returns the calibration parameters, serial number and other information about the camera being used.
As calibration parameters depend on the image resolution, you can provide a custom resolution as a parameter to get scaled information. When reading an SVO file, the parameters will correspond to the camera used for recording.
resizer | : You can specify a size different from default image size to get the scaled camera information. default = (0,0) meaning original image size. |
def get_runtime_parameters | ( | self | ) |
Returns the runtime parameters used.
Corresponds to the structure sent when the grab() function was called
def get_init_parameters | ( | self | ) |
Returns the init parameters used.
Corresponds to the structure sent when the open() function was called
def get_positional_tracking_parameters | ( | self | ) |
Returns the positional tracking parameters used.
Corresponds to the structure sent when the Camera.enable_positional_tracking() function was called.
def get_spatial_mapping_parameters | ( | self | ) |
Returns the spatial mapping parameters used.
Corresponds to the structure sent when the Camera.enable_spatial_mapping() function was called.
def get_object_detection_parameters | ( | self | ) |
Returns the object detection parameters used.
Corresponds to the structure sent when the Camera.enable_object_detection() function was called
def get_streaming_parameters | ( | self | ) |
Returns the streaming parameters used.
Corresponds to the structure sent when the Camera.enable_streaming() function was called.
def enable_positional_tracking | ( | self, | |
py_tracking = PositionalTrackingParameters() |
|||
) |
Initializes and starts the positional tracking processes.
This function allows you to enable the position estimation of the SDK. It only has to be called once in the camera's lifetime.
When enabled, the position will be updated at each grab call. Tracking-specific parameters can be set by providing PositionalTrackingParameters to this function.
py_tracking | : structure containing all the PositionalTrackingParameters . default : a preset of PositionalTrackingParameters. |
def update_self_calibration | ( | self | ) |
Performs a new self calibration process.
In some cases, due to temperature changes or strong vibrations, the stereo calibration becomes less accurate. Use this function to update the self-calibration data and get more reliable depth values.
def get_sensors_data | ( | self, | |
SensorsData | py_sensors_data, | ||
time_reference = TIME_REFERENCE.CURRENT |
|||
) |
Retrieves the Sensors (IMU,magnetometer,barometer) Data at a specific time reference.
Calling get_sensors_data with TIME_REFERENCE.CURRENT gives you the latest sensors data received. Getting all the data requires to call this function at 800Hz in a thread. Calling get_sensors_data with TIME_REFERENCE.IMAGE gives you the sensors data at the time of the latest image grabbed.
SensorsData object contains the previous IMUData structure that was used in ZED SDK v2.X: For IMU data, the values are provided in 2 ways : Time-fused pose estimation that can be accessed using:
data.imu.timestamp
def set_imu_prior | ( | self, | |
Transform | transfom | ||
) |
Set an optional IMU orientation hint that will be used to assist the tracking during the next grab().
This function can be used to assist the positional tracking rotation while using a ZED Mini.
It needs to be called before the grab() function.
transform | : Transform to be ingested into IMU fusion. Note that only the rotation is used. |
def get_position | ( | self, | |
Pose | py_pose, | ||
reference_frame = REFERENCE_FRAME.WORLD |
|||
) |
Retrieves the estimated position and orientation of the camera in the specified reference frame.
Using REFERENCE_FRAME.WORLD, the returned pose relates to the initial position of the camera. (PositionalTrackingParameters.initial_world_transform ) Using REFERENCE_FRAME.CAMERA, the returned pose relates to the previous position of the camera.
If the tracking has been initialized with PositionalTrackingParameters.enable_area_memory to true (default), this function can return POSITIONAL_TRACKING_STATE::SEARCHING. This means that the tracking lost its link to the initial referential and is currently trying to relocate the camera. However, it will keep on providing position estimations.
camera_pose | [out]: the pose containing the position of the camera and other information (timestamp, confidence) |
reference_frame | : defines the reference from which you want the pose to be expressed. Default : REFERENCE_FRAME::WORLD. |
Extract Rotation Matrix : camera_pose.get_rotation()
Extract Translation Vector : camera_pose.get_translation()
Extract Orientation / quaternion : camera_pose.get_orientation()
def get_area_export_state | ( | self | ) |
Returns the state of the spatial memory export process.
As Camera.save_area_map() only starts the exportation, this function allows you to know when the exportation finished or if it failed.
def save_area_map | ( | self, | |
area_file_path = "" |
|||
) |
Saves the current area learning file.
The file will contain spatial memory data generated by the tracking.
If the tracking has been initialized with PositionalTrackingParameters.enable_area_memory to true (default), the function allows you to export the spatial memory. Reloading the exported file in a future session with PositionalTrackingParameters.area_file_path initializes the tracking within the same referential. This function is asynchronous, and only triggers the file generation. You can use get_area_export_state() to get the export state. The positional tracking keeps running while exporting.
area_file_path | : saves the spatial memory database in an '.area' file. |
def disable_positional_tracking | ( | self, | |
area_file_path = "" |
|||
) |
Disables the positional tracking.
The positional tracking is immediately stopped. If a file path is given, save_area_map() will be called asynchronously. See get_area_export_state() to get the exportation state. If the tracking has been enabled, this function will automatically be called by close() .
area_file_path | : if set, saves the spatial memory into an '.area' file. default : (empty) area_file_path is the name and path of the database, e.g. "path/to/file/myArea1.area". |
def reset_positional_tracking | ( | self, | |
Transform | path | ||
) |
Resets the tracking, and re-initializes the position with the given transformation matrix.
path | : Position of the camera in the world frame when the function is called. By default, it is set to identity. |
def enable_spatial_mapping | ( | self, | |
py_spatial = SpatialMappingParameters() |
|||
) |
Initializes and starts the spatial mapping processes.
The spatial mapping will create a geometric representation of the scene based on both tracking data and 3D point clouds. The resulting output can be a Mesh or a FusedPointCloud. It can be be obtained by calling extract_whole_spatial_map() or retrieve_spatial_map_async(). Note that retrieve_spatial_map_async should be called after request_spatial_map_async().
py_spatial | : the structure containing all the specific parameters for the spatial mapping. Default: a balanced parameter preset between geometric fidelity and output file size. For more information, see the SpatialMappingParameters documentation. |
def pause_spatial_mapping | ( | self, | |
bool | status | ||
) |
Pauses or resumes the spatial mapping processes.
As spatial mapping runs asynchronously, using this function can pause its computation to free some processing power, and resume it again later. For example, it can be used to avoid mapping a specific area or to pause the mapping when the camera is static.
status | : if true, the integration is paused. If false, the spatial mapping is resumed. |
def get_spatial_mapping_state | ( | self | ) |
Returns the current spatial mapping state.
As the spatial mapping runs asynchronously, this function allows you to get reported errors or status info.
See also SPATIAL_MAPPING_STATE
def request_spatial_map_async | ( | self | ) |
Starts the spatial map generation process in a non blocking thread from the spatial mapping process.
The spatial map generation can take a long time depending on the mapping resolution and covered area. This function will trigger the generation of a mesh without blocking the program. You can get info about the current generation using get_spatial_map_request_status_async(), and retrieve the mesh using retrieve_spatial_map_async().
def get_spatial_map_request_status_async | ( | self | ) |
Returns the spatial map generation status.
This status allows to know if the mesh can be retrieved by calling retrieve_spatial_map_async()
def retrieve_spatial_map_async | ( | self, | |
py_mesh | |||
) |
Retrieves the current generated spatial map.
After calling retrieve_spatial_map_async() , this function allows you to retrieve the generated mesh or fused point cloud. The Mesh or FusedPointCloud will only be available when get_spatial_map_request_status_async() returns ERROR_CODE.SUCCESS
py_mesh | : [out] The Mesh or FusedPointCloud to be filled with the generated spatial map. |
See request_spatial_map_async() for an example.
def extract_whole_spatial_map | ( | self, | |
py_mesh | |||
) |
Extracts the current spatial map from the spatial mapping process.
If the object to be filled already contains a previous version of the mesh / fused point cloud, only changes will be updated, optimizing performance.
py_mesh | : [out] The Mesh or FuesedPointCloud to be filled with the generated spatial map. |
def find_plane_at_hit | ( | self, | |
coord, | |||
Plane | py_plane | ||
) |
Checks the plane at the given left image coordinates.
This function gives the 3D plane corresponding to a given pixel in the latest left image grabbed. The pixel coordinates are expected to be contained between 0 and get_camera_informations().camera_resolution.width-1 and get_camera_informations().camera_resolution.height-1
coord | : [in] The image coordinate. The coordinate must be taken from the full-size image |
plane | : [out] The detected plane if the function succeeded |
def find_floor_plane | ( | self, | |
Plane | py_plane, | ||
Transform | resetTrackingFloorFrame, | ||
floor_height_prior = float('nan') , |
|||
world_orientation_prior = Rotation(Matrix3f().zeros()) , |
|||
floor_height_prior_tolerance = float('nan') |
|||
) |
Detect the floor plane of the scene.
This function analyses the latest image and depth to estimate the floor plane of the scene.
It expects the floor plane to be visible and bigger than other candidate planes, like a table.
py_plane | : [out] The detected floor plane if the function succeeded |
resetTrackingFloorFrame | : [out] The transform to align the tracking with the floor plane. The initial position will then be at ground height, with the axis align with the gravity. The positional tracking needs to be reset/enabled |
floor_height_prior | : [in] Prior set to locate the floor plane depending on the known camera distance to the ground, expressed in the same unit as the ZED. If the prior is too far from the detected floor plane, the function will return ERROR_CODE.PLANE_NOT_FOUND |
world_orientation_prior | : [in] Prior set to locate the floor plane depending on the known camera orientation to the ground. If the prior is too far from the detected floor plane, the function will return ERROR_CODE.PLANE_NOT_FOUND |
floor_height_prior_tolerance | : [in] Prior height tolerance, absolute value. |
def disable_spatial_mapping | ( | self | ) |
Disables the spatial mapping process.
The spatial mapping is immediately stopped. If the mapping has been enabled, this function will automatically be called by close() .
def enable_streaming | ( | self, | |
streaming_parameters = StreamingParameters() |
|||
) |
Creates a streaming pipeline for images.
streaming_parameters | : the structure containing all the specific parameters for the streaming. |
def disable_streaming | ( | self | ) |
Disables the streaming initiated by enable_straming()
See enable_streaming() for an example.
def enable_recording | ( | self, | |
RecordingParameters | record | ||
) |
Creates an SVO file to be filled by record().
SVO files are custom video files containing the un-rectified images from the camera along with some meta-data like timestamps or IMU orientation (if applicable). They can be used to simulate a live ZED and test a sequence with various SDK parameters. Depending on the application, various compression modes are available. See SVO_COMPRESSION_MODE.
record | : RecordingParameters such as filename and compression mode |
def disable_recording | ( | self | ) |
Disables the recording initiated by enable_recording() and closes the generated file.
See enable_recording() for an example.
def get_recording_status | ( | self | ) |
Get the recording information.
def pause_recording | ( | self, | |
value = True |
|||
) |
Pauses or resumes the recording.
status | : if true, the recording is paused. If false, the recording is resumed. |
def get_recording_parameters | ( | self | ) |
Returns the recording parameters used.
Corresponds to the structure sent when the enable_recording() function was called
def enable_object_detection | ( | self, | |
object_detection_parameters = ObjectDetectionParameters() |
|||
) |
Initializes and starts the object detection module.
The object detection module will detect and track objects, people or animals in range of the camera, the full list of detectable objects is available in OBJECT_CLASS.
Detected objects can be retrieved using the retrieve_objects() function.
As detecting and tracking the objects is CPU and GPU-intensive, the module can be used synchronously or asynchronously using ObjectDetectionParameters.image_sync .
object_detection_parameters | : Structure containing all specific parameters for object detection. |
For more information, see the ObjectDetectionParameters documentation
def disable_object_detection | ( | self | ) |
Disables the Object Detection process.
The object detection module immediately stops and frees its memory allocations. If the object detection has been enabled, this function will automatically be called by close().
def pause_object_detection | ( | self, | |
bool | status | ||
) |
Pauses or resumes the object detection processes.
If the object detection has been enabled with ObjectDetectionParameters.image_sync set to false (running asynchronously), this function will pause processing. While in pause, calling this function with status = false will resume the object detection. The retrieve_objects function will keep on returning the last objects detected while in pause.
status | : If true, object detection is paused. If false, object detection is resumed. |
def retrieve_objects | ( | self, | |
Objects | py_objects, | ||
object_detection_parameters = ObjectDetectionRuntimeParameters() |
|||
) |
Retrieve objects detected by the object detection module.
This function returns the result of the object detection, whether the module is running synchronously or asynchronously.
It is recommended to keep the same Objects object as the input of all calls to this function. This will enable the identification and the tracking of every objects detected.
py_objects | : [in,out] The detected objects will be saved into this object. If the object already contains data from a previous detection, it will be updated, keeping a unique ID for the same person. |
object_detection_parameters | : [in] Object detection runtime settings, can be changed at each detection. In async mode, the parameters update is applied on the next iteration. |
def get_objects_batch | ( | self, | |
list[ObjectsBatch] | trajectories | ||
) |
Get a batch of detected objects.
trajectories | : list of ObjectsBatch that will be filled by the batching queue process. An empty list should be passed to the function |
def ingest_custom_box_objects | ( | self, | |
list[CustomBoxObjectData] | objects_in | ||
) |
Feed the 3D Object tracking function with your own 2D bounding boxes from your own detection algorithm.
objects_in | : list of CustomBoxObjectData. |
|
static |
Lists all the connected devices with their associated information.
This function lists all the cameras available and provides their serial number, models and other information.
|
static |
Lists all the streaming devices with their associated information.
|
static |
Performs an hardware reset of the ZED 2.
sn | : Serial number of the camera to reset, or 0 to reset the first camera detected. |
fullReboot | : If set to True, performs a full reboot (Sensors and Video modules). Default: True |