zed_interface.h File Reference

Go to the source code of this file.

Functions

INTERFACE_API void sl_unload_all_instances ()
 Forces unload of all instances.
 
INTERFACE_API void sl_unload_instance (int camera_id)
 Forces unload of one instance. More...
 
INTERFACE_API bool sl_find_usb_device (enum USB_DEVICE device)
 Checks usb devices connected. param device : type of device to find. More...
 
INTERFACE_API bool sl_create_camera (int camera_id)
 Creates a camera with resolution mode, fps and id for linux. More...
 
INTERFACE_API bool sl_is_opened (int camera_id)
 Reports if the camera has been successfully opened. More...
 
INTERFACE_API int sl_open_camera (int camera_id, struct SL_InitParameters *init_parameters, const unsigned int serial_number, const char *path_svo, const char *ip, int stream_port, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
 Opens the ZED camera from the provided SL_InitParameters. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_start_publishing (int camera_id, struct SL_CommunicationParameters *comm_params)
 Set this camera as a data provider for the Fusion module. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_stop_publishing (int camera_id)
 Set this camera as normal camera(without data providing).
Stop to send camera data to fusion. More...
 
INTERFACE_API CUcontext sl_get_cuda_context (int camera_id)
 Gets the Camera-created CUDA context for sharing it with other CUDA-capable libraries. More...
 
INTERFACE_API struct SL_InitParameterssl_get_init_parameters (int camera_id)
 Returns the SL_InitParameters used. More...
 
INTERFACE_API struct SL_RuntimeParameterssl_get_runtime_parameters (int camera_id)
 Returns the SL_RuntimeParameters used. More...
 
INTERFACE_API struct SL_PositionalTrackingParameterssl_get_positional_tracking_parameters (int camera_id)
 Returns the SL_PositionalTrackingParameters used. More...
 
INTERFACE_API void sl_close_camera (int camera_id)
 Close an opened camera and disable the textures. More...
 
INTERFACE_API int sl_set_region_of_interest (int camera_id, void *roi_mask, bool module[SL_MODULE_LAST])
 Defines a region of interest to focus on for all the SDK, discarding other parts. More...
 
INTERFACE_API int sl_get_region_of_interest (int camera_id, void *roi_mask, int width, int height, enum SL_MODULE module)
 Get the previously set or computed region of interest. More...
 
INTERFACE_API int sl_start_region_of_interest_auto_detection (int camera_id, struct SL_RegionOfInterestParameters *roi_param)
 Start the auto detection of a region of interest to focus on for all the SDK, discarding other parts. This detection is based on the general motion of the camera combined with the motion in the scene. The camera must move for this process, an internal motion detector is used, based on the Positional Tracking module. It requires a few hundreds frames of motion to compute the mask. More...
 
INTERFACE_API enum SL_REGION_OF_INTEREST_AUTO_DETECTION_STATE sl_get_region_of_interest_auto_detection_status (int camera_id)
 Return the status of the automatic Region of Interest Detection The automatic Region of Interest Detection is enabled by using sl_start_region_of_interest_auto_detection. More...
 
INTERFACE_API int sl_grab (int camera_id, struct SL_RuntimeParameters *runtime)
 Grabs the latest images from the camera. More...
 
INTERFACE_API void sl_get_device_list (struct SL_DeviceProperties device_list[MAX_CAMERA_PLUGIN], int *nb_devices)
 Lists all the connected devices with their associated information. More...
 
INTERFACE_API void sl_get_streaming_device_list (struct SL_StreamingProperties streaming_device_list[MAX_CAMERA_PLUGIN], int *nb_devices)
 List all the streaming devices with their associated information. More...
 
INTERFACE_API int sl_reboot (int sn, bool full_reboot)
 Performs a hardware reset of the ZED 2 and the ZED 2i. More...
 
INTERFACE_API int sl_enable_recording (int camera_id, const char *filename, enum SL_SVO_COMPRESSION_MODE compression_mode, unsigned int bitrate, int target_fps, bool transcode)
 Creates a file for recording the ZED's output into a .SVO or .AVI video. More...
 
INTERFACE_API struct SL_RecordingStatussl_get_recording_status (int camera_id)
 Get the recording information. More...
 
INTERFACE_API void sl_disable_recording (int camera_id)
 Disables the recording initiated by sl_enable_recording() and closes the generated file. More...
 
INTERFACE_API struct SL_RecordingParameterssl_get_recording_parameters (int camera_id)
 Returns the SL_RecordingParameters used. More...
 
INTERFACE_API void sl_pause_recording (int camera_id, bool status)
 Pauses or resumes the recording. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_ingest_data_into_svo (int camera_id, struct SL_SVOData *data)
 Ingests SL_SVOData in a SVO file. More...
 
INTERFACE_API int sl_get_svo_data_size (int camera_id, char key[128], unsigned long long ts_begin, unsigned long long ts_end)
 Gets the size of data available for a given key. Must be called before sl_retrieve_svo_data to initialize the array at the correct size. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_retrieve_svo_data (int camera_id, char key[128], int nb_data, struct SL_SVOData *data, unsigned long long ts_begin, unsigned long long ts_end)
 Retrieves SVOData from an SVO file. The user is reponsible for correctly allocating the size of the data array using sl_get_svo_data_size. More...
 
INTERFACE_API int sl_get_svo_data_keys_size (int camera_id)
 Gets the number of external channels that can be retrieved from the SVO file. More...
 
INTERFACE_API void sl_get_svo_data_keys (int camera_id, int nb_keys, char *keys[128])
 Gets the external channels that can be retrieved from the SVO file. The user is reponsible for correctly allocating the size of the keys array using sl_get_svo_data_keys_size. More...
 
INTERFACE_API int sl_enable_positional_tracking (int camera_id, struct SL_PositionalTrackingParameters *tracking_param, const char *area_file_path)
 Initializes and starts the positional tracking processes. More...
 
INTERFACE_API void sl_disable_positional_tracking (int camera_id, const char *area_file_path)
 Disables the positional tracking. More...
 
INTERFACE_API int sl_save_area_map (int camera_id, const char *area_file_path)
 Saves the current area learning file. The file will contain spatial memory data generated by the tracking. More...
 
INTERFACE_API int sl_get_area_export_state (int camera_id)
 Returns the state of the spatial memory export process. More...
 
INTERFACE_API void sl_set_svo_position (int camera_id, int frame_number)
 Sets the playback cursor to the desired frame number in the SVO file. More...
 
INTERFACE_API float sl_get_camera_fps (int camera_id)
 Returns the camera FPS. More...
 
INTERFACE_API float sl_get_current_fps (int camera_id)
 Returns the current FPS. More...
 
int INTERFACE_API sl_get_width (int camera_id)
 Returns the width of the current image. More...
 
int INTERFACE_API sl_get_height (int camera_id)
 Returns the height of the current image. More...
 
INTERFACE_API int sl_get_confidence_threshold (int camera_id)
 Gets the current confidence threshold value for the disparity map (and by extension the depth map). More...
 
INTERFACE_API struct SL_CameraInformationsl_get_camera_information (int camera_id, int res_width, int res_height)
 Returns the SL_CameraInformation associated the camera. More...
 
INTERFACE_API void sl_update_self_calibration (int camera_id)
 Performs a new self calibration process. More...
 
INTERFACE_API struct SL_CalibrationParameterssl_get_calibration_parameters (int camera_id, bool raw_params)
 Gets the Calibration Parameters. More...
 
INTERFACE_API struct SL_SensorsConfigurationsl_get_sensors_configuration (int camera_id)
 Gets the Sensors configuration. More...
 
INTERFACE_API void sl_get_camera_imu_transform (int camera_id, struct SL_Vector3 *translation, struct SL_Quaternion *rotation)
 Gets the IMU to the left camera transform matrix. More...
 
INTERFACE_API int sl_get_input_type (int camera_id)
 Gets the input type (see SL_INPUT_TYPE). More...
 
INTERFACE_API int sl_get_zed_serial (int camera_id)
 Gets the ZED Serial Number. More...
 
INTERFACE_API int sl_get_camera_firmware (int camera_id)
 Gets the ZED camera current firmware version. More...
 
INTERFACE_API int sl_get_sensors_firmware (int camera_id)
 Gets the sensor module current firmware version. More...
 
INTERFACE_API int sl_get_camera_model (int camera_id)
 Gets the ZED Camera model (see SL_MODEL). More...
 
INTERFACE_API unsigned long long sl_get_image_timestamp (int camera_id)
 Get the timestamp at the time the frame has been extracted from USB stream. More...
 
INTERFACE_API unsigned long long sl_get_current_timestamp (int camera_id)
 Get the current timestamp at the time the function is called. More...
 
INTERFACE_API int sl_get_svo_number_of_frames (int camera_id)
 Returns the number of frames in the SVO file. More...
 
INTERFACE_API bool sl_is_camera_setting_supported (int camera_id, enum SL_VIDEO_SETTINGS setting)
 Test if the video setting is supported by the camera. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings (int camera_id, enum SL_VIDEO_SETTINGS mode, int value)
 Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.). More...
 
INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings_min_max (int camera_id, enum SL_VIDEO_SETTINGS mode, int min, int max)
 Sets the range values of the requested camera setting (gain, brightness, hue, exposure, etc.). Works for the following settings: SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_EXPOSURE_TIME_RANGE SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_ANALOG_GAIN_RANGE SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_DIGITAL_GAIN_RANGE. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_set_roi_for_aec_agc (int camera_id, enum SL_SIDE side, struct SL_Rect *roi, bool reset)
 Sets the region of interest for automatic exposure/gain computation. More...
 
INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings (int c_id, enum SL_VIDEO_SETTINGS mode, int *value)
 Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.). More...
 
INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings_min_max (int c_id, enum SL_VIDEO_SETTINGS mode, int *minvalue, int *maxvalue)
 Returns the current range of the requested camera setting (setting with range value). More...
 
INTERFACE_API enum SL_ERROR_CODE sl_get_roi_for_aec_agc (int id, enum SL_SIDE side, struct SL_Rect *roi)
 Gets the region of interest for automatic exposure/gain computation. More...
 
INTERFACE_API float sl_get_depth_min_range_value (int camera_id)
 Gets the depth min value from InitParameters (see SL_InitParameters::depth_minimum_distance). More...
 
INTERFACE_API float sl_get_depth_max_range_value (int camera_id)
 Gets the depth max value from InitParameters (see SL_InitParameters::depth_maximum_distance). More...
 
INTERFACE_API int sl_get_current_min_max_depth (int camera_id, float *min, float *max)
 Gets the current range of perceived depth. More...
 
INTERFACE_API int sl_get_number_zed_connected ()
 Gets the number of zed connected. More...
 
INTERFACE_API char * sl_get_sdk_version ()
 Returns the version of the currently installed ZED SDK. More...
 
INTERFACE_API int sl_convert_coordinate_system (struct SL_Quaternion *rotation, struct SL_Vector3 *translation, enum SL_COORDINATE_SYSTEM coord_system_src, enum SL_COORDINATE_SYSTEM coord_system_dest)
 Change the coordinate system of a transform matrix. More...
 
INTERFACE_API int sl_get_svo_position (int camera_id)
 Returns the current playback position in the SVO file. More...
 
INTERFACE_API int sl_get_svo_position_at_timestamp (int camera_id, unsigned long long timestamp)
 Retrieves the frame index within the SVO file corresponding to the provided timestamp. More...
 
INTERFACE_API unsigned int sl_get_frame_dropped_count (int camera_id)
 Gets the number of frames dropped since sl_grab() was called for the first time. Based on camera timestamps and an FPS comparison. More...
 
INTERFACE_API bool sl_is_positional_tracking_enabled (int camera_id)
 Tells if the tracking module is enabled. More...
 
INTERFACE_API int sl_get_position_at_target_frame (int camera_id, struct SL_Quaternion *rotation, struct SL_Vector3 *position, struct SL_Quaternion *target_quaternion, struct SL_Vector3 *target_translation, enum SL_REFERENCE_FRAME reference_frame)
 Gets the current position of the camera and state of the tracking, with an optional offset to the tracking frame. More...
 
INTERFACE_API int sl_get_position_data (int camera_id, struct SL_PoseData *poseData, enum SL_REFERENCE_FRAME reference_frame)
 Gets the current position of the camera and state of the tracking, filling a SL_PoseData struck useful for AR pass-though. More...
 
INTERFACE_API int sl_get_position (int camera_id, struct SL_Quaternion *rotation, struct SL_Vector3 *position, enum SL_REFERENCE_FRAME reference_frame)
 Retrieves the estimated position and orientation of the camera in the specified reference frame. More...
 
INTERFACE_API int sl_get_position_array (int camera_id, float *pose, enum SL_REFERENCE_FRAME reference_frame)
 Gets the position of the camera and the current state of the ZED Tracking as a float array (4x4). More...
 
INTERFACE_API struct SL_PositionalTrackingStatussl_get_positional_tracking_status (int camera_id)
 Return the current status of positional tracking module. More...
 
INTERFACE_API int sl_reset_positional_tracking (int camera_id, struct SL_Quaternion rotation, struct SL_Vector3 translation)
 Resets the tracking, and re-initializes the position with the given pose. More...
 
INTERFACE_API int sl_reset_positional_tracking_with_offset (int camera_id, struct SL_Quaternion rotation, struct SL_Vector3 translation, struct SL_Quaternion target_quaternion, struct SL_Vector3 target_translation)
 Resets the tracking with an offset. More...
 
INTERFACE_API int sl_set_imu_prior_orientation (int camera_id, struct SL_Quaternion rotation)
 Set an optional IMU orientation hint that will be used to assist the tracking during the next sl_grab(). More...
 
INTERFACE_API int sl_get_imu_orientation (int camera_id, struct SL_Quaternion *quat, enum SL_TIME_REFERENCE time_reference)
 Gets the rotation given by the IMU. More...
 
INTERFACE_API int sl_get_sensors_data (int camera_id, struct SL_SensorsData *data, enum SL_TIME_REFERENCE time_reference)
 Gets SL_SensorsData (IMU, magnetometer, barometer) at a specific time reference. More...
 
INTERFACE_API void sl_spatial_mapping_merge_chunks (int camera_id, int nb_faces, int *nb_vertices, int *nb_triangles, int *nb_updated_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, const int max_submesh)
 Consolidates the chucks from a scan. This is used to turn a lots of small meshes (which are efficient for the scanning process) into several large meshes (which are more convenient to work with). More...
 
INTERFACE_API int sl_enable_spatial_mapping (int camera_id, struct SL_SpatialMappingParameters *mapping_param)
 Initializes and starts the spatial mapping processes. More...
 
INTERFACE_API void sl_disable_spatial_mapping (int camera_id)
 Disables the spatial mapping process. More...
 
INTERFACE_API struct SL_SpatialMappingParameterssl_get_spatial_mapping_parameters (int camera_id)
 Returns the SL_SpatialMappingParameters used. More...
 
INTERFACE_API void sl_pause_spatial_mapping (int camera_id, bool status)
 
INTERFACE_API void sl_request_mesh_async (int camera_id)
 Starts the spatial map generation process in a non-blocking thread from the spatial mapping process. More...
 
INTERFACE_API int sl_get_mesh_request_status_async (int camera_id)
 Returns the spatial map generation status. More...
 
INTERFACE_API enum SL_SPATIAL_MAPPING_STATE sl_get_spatial_mapping_state (int camera_id)
 Returns the current spatial mapping state. More...
 
INTERFACE_API int sl_update_mesh (int camera_id, int *nb_vertices_per_submesh, int *nb_triangles_per_submesh, int *nb_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, const int max_submesh)
 Updates the internal version of the mesh and returns the sizes of the meshes. More...
 
INTERFACE_API int sl_retrieve_mesh (int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr, const int max_submeshes)
 Retrieves all chunks of the current mesh. More...
 
INTERFACE_API int sl_update_chunks (int camera_id, int *nb_vertices_per_submesh, int *nb_triangles_per_submesh, int *nb_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, const int max_submesh)
 Updates the Internal version of the mesh and returns the sizes of the meshes. More...
 
INTERFACE_API int sl_retrieve_chunks (int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr, const int max_submesh)
 Retrieves all chunks of the full mesh. More...
 
INTERFACE_API int sl_update_fused_point_cloud (int camera_id, int *nb_vertices_tot)
 Updates the fused point cloud (if spatial map type was SL_SPATIAL_MAP_TYPE_FUSED_POINT_CLOUD). More...
 
INTERFACE_API int sl_retrieve_fused_point_cloud (int camera_id, float *vertices)
 Retrieves all points of the fused point cloud. More...
 
INTERFACE_API int sl_extract_whole_spatial_map (int camera_id)
 Extracts the current spatial map from the spatial mapping process. More...
 
INTERFACE_API bool sl_save_mesh (int camera_id, const char *filename, enum SL_MESH_FILE_FORMAT format)
 Saves the scanned mesh in a specific file format. More...
 
INTERFACE_API bool sl_save_point_cloud (int c_id, const char *filename, enum SL_MESH_FILE_FORMAT format)
 Saves the scanned point cloud in a specific file format. More...
 
INTERFACE_API bool sl_load_mesh (int camera_id, const char *filename, int *nb_vertices_per_submesh, int *nb_triangles_per_submesh, int *num_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, int *textures_size, const int max_submesh)
 Loads a saved mesh file. More...
 
INTERFACE_API bool sl_apply_texture (int camera_id, int *nb_vertices_per_submesh, int *nb_triangles_per_submesh, int *nb_updated_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, int *textures_size, const int max_submesh)
 Applies the scanned texture onto the internal scanned mesh. More...
 
INTERFACE_API bool sl_filter_mesh (int camera_id, enum SL_MESH_FILTER filter_params, int *nb_vertices_per_submesh, int *nb_triangles_per_submesh, int *nb_updated_submeshes, int *updated_indices, int *nb_vertices_tot, int *nb_triangles_tot, const int max_submesh)
 Filters a mesh to removes triangles while still preserving its overall shaper (though less accurate). More...
 
INTERFACE_API void sl_spatial_mapping_get_gravity_estimation (int camera_id, struct SL_Vector3 *gravity)
 Gets a vector pointing toward the direction of gravity. This is estimated from a 3D scan of the environment, and such, a scan must be started and finished for this value to be calculated.
If using a model other than SL_MODEL_ZED, this isn't required thanks to its IMU. More...
 
INTERFACE_API int sl_update_whole_mesh (int camera_id, int *nb_vertices, int *nb_triangles)
 Updates the internal version of the whole mesh and returns the size of its data. More...
 
INTERFACE_API int sl_retrieve_whole_mesh (int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr)
 Retrieves the full mesh. Call update_mesh before calling this. Vertex and triangles arrays must be at least of the sizes returned by update_mesh (nb_vertices and nbTriangles). More...
 
INTERFACE_API bool sl_load_whole_mesh (int camera_id, const char *filename, int *nb_vertices, int *nb_triangles, int *texture_size)
 Loads a saved mesh file. More...
 
INTERFACE_API bool sl_apply_whole_texture (int camera_id, int *nb_vertices, int *nb_triangles, int *texture_size)
 Applies the scanned texture onto the internal scanned mesh. More...
 
INTERFACE_API bool sl_filter_whole_mesh (int camera_id, enum SL_MESH_FILTER filter_params, int *nb_vertices, int *nb_triangles)
 Filters a mesh to removes triangles while still preserving its overall shaper (though less accurate). More...
 
INTERFACE_API struct SL_PlaneDatasl_find_floor_plane (int camera_id, struct SL_Quaternion *reset_quaternion, struct SL_Vector3 *reset_translation, struct SL_Quaternion prior_rotation, struct SL_Vector3 prior_translation)
 Detect the floor plane of the scene. More...
 
INTERFACE_API struct SL_PlaneDatasl_find_plane_at_hit (int camera_id, struct SL_Vector2 pixel, struct SL_PlaneDetectionParameters *params, bool thres)
 Checks the plane at the given left image coordinates. More...
 
INTERFACE_API int sl_convert_floorplane_to_mesh (int camera_id, float *vertices, int *triangles, int *nb_vertices_tot, int *nb_triangles_tot)
 Using data from a detected floor plane, updates supplied vertex and triangles arrays with data needed to make a mesh that represents it. More...
 
INTERFACE_API int sl_convert_hitplane_to_mesh (int camera_id, float *vertices, int *triangles, int *nb_vertices_tot, int *nb_triangles_tot)
 Using data from a detected hit plane, updates supplied vertex and triangles arrays with data needed to make a mesh that represents it. More...
 
INTERFACE_API int sl_retrieve_measure (int camera_id, void *measure_ptr, enum SL_MEASURE type, enum SL_MEM mem, int width, int height)
 Retrieves a measure texture from the ZED SDK. More...
 
INTERFACE_API int sl_retrieve_image (int camera_id, void *image_ptr, enum SL_VIEW type, enum SL_MEM mem, int width, int height)
 Retrieves an image texture from the ZED SDK in a human-viewable format. More...
 
INTERFACE_API int sl_convert_image (void *image_in_ptr, void *image_signed_ptr, cudaStream_t stream)
 Convert Image format from Unsigned char to Signed char, designed for Unreal Engine pipeline, works on GPU memory. More...
 
INTERFACE_API int sl_enable_streaming (int camera_id, enum SL_STREAMING_CODEC codec, unsigned int bitrate, unsigned short port, int gop_size, int adaptative_bitrate, int chunk_size, int target_framerate)
 Creates a streaming pipeline. More...
 
INTERFACE_API void sl_disable_streaming (int camera_id)
 Disables the streaming initiated by sl_enable_streaming(). More...
 
INTERFACE_API int sl_is_streaming_enabled (int camera_id)
 Tells if the streaming is running. More...
 
INTERFACE_API struct SL_StreamingParameterssl_get_streaming_parameters (int camera_id)
 Returns the SL_StreamingParameters used. More...
 
INTERFACE_API int sl_save_current_image (int camera_id, enum SL_VIEW view, const char *file_name)
 Writes the image into a file defined by its extension. More...
 
INTERFACE_API int sl_save_current_depth (int camera_id, enum SL_SIDE side, const char *file_name)
 Writes the depth map into a file defined by its extension. More...
 
INTERFACE_API int sl_save_current_point_cloud (int camera_id, enum SL_SIDE side, const char *file_name)
 Writes the point cloud into a file defined by its extension. More...
 
INTERFACE_API struct SL_AI_Model_statussl_check_AI_model_status (enum SL_AI_MODELS model, int gpu_id)
 Check if a corresponding optimized engine is found for the requested Model based on your rig configuration. More...
 
INTERFACE_API int sl_optimize_AI_model (enum SL_AI_MODELS model, int gpu_id)
 Optimize the requested model, possible download if the model is not present on the host. More...
 
INTERFACE_API int sl_enable_object_detection (int camera_id, struct SL_ObjectDetectionParameters *object_detection_parameters)
 Initializes and starts object detection module. More...
 
INTERFACE_API struct SL_ObjectDetectionParameterssl_get_object_detection_parameters (int camera_id)
 Returns the SL_ObjectDetectionParameters used. More...
 
INTERFACE_API void sl_disable_object_detection (int camera_id, unsigned int instance_id, bool force_disable_all_instances)
 Disables the Object Detection process. More...
 
INTERFACE_API int sl_enable_body_tracking (int camera_id, struct SL_BodyTrackingParameters *body_tracking_parameters)
 Initializes and starts the Deep Learning Body Tracking module. More...
 
INTERFACE_API struct SL_BodyTrackingParameterssl_get_body_tracking_parameters (int camera_id)
 Returns the SL_BodyTrackingParameters used. More...
 
INTERFACE_API void sl_disable_body_tracking (int camera_id, unsigned int instance_id, bool force_disable_all_instances)
 Disables the body tracking process. More...
 
INTERFACE_API int sl_generate_unique_id (char *uuid)
 Generate a UUID like unique id to help identify and track AI detections. More...
 
INTERFACE_API int sl_ingest_custom_box_objects (int camera_id, int nb_objects, struct SL_CustomBoxObjectData *objects_in)
 Feed the 3D Object tracking function with your own 2D bounding boxes from your own detection algorithm. More...
 
INTERFACE_API int sl_retrieve_objects (int camera_id, struct SL_ObjectDetectionRuntimeParameters *object_detection_runtime_parameters, struct SL_Objects *objects, unsigned int instance_id)
 Retrieve objects detected by the object detection module. More...
 
INTERFACE_API int sl_retrieve_bodies (int camera_id, struct SL_BodyTrackingRuntimeParameters *body_tracking_runtime_parameters, struct SL_Bodies *bodies, unsigned int instance_id)
 Retrieve bodies detected by the body tracking module. More...
 
INTERFACE_API int sl_update_objects_batch (int camera_id, int *nb_batches)
 Updates the internal batch of detected objects. More...
 
INTERFACE_API int sl_get_objects_batch (int camera_id, int index, struct SL_ObjectsBatch *objs_batch)
 Gets a batch of detected objects. More...
 
INTERFACE_API int sl_get_objects_batch_csharp (int camera_id, int index, int *nb_data, int *id, int *label, int *sublabel, int *tracking_state, struct SL_Vector3 positions[MAX_TRAJECTORY_SIZE], float position_covariances[MAX_TRAJECTORY_SIZE][6], struct SL_Vector3 velocities[MAX_TRAJECTORY_SIZE], unsigned long long timestamps[MAX_TRAJECTORY_SIZE], struct SL_Vector2 bounding_boxes_2d[MAX_TRAJECTORY_SIZE][4], struct SL_Vector3 bounding_boxes[MAX_TRAJECTORY_SIZE][8], float confidences[MAX_TRAJECTORY_SIZE], int action_states[MAX_TRAJECTORY_SIZE], struct SL_Vector2 head_bounding_boxes_2d[MAX_TRAJECTORY_SIZE][4], struct SL_Vector3 head_bounding_boxes[MAX_TRAJECTORY_SIZE][8], struct SL_Vector3 head_positions[MAX_TRAJECTORY_SIZE])
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_init (struct SL_InitFusionParameters *params)
 FusionHandler initialisation. Initializes memory/generic datas. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_process ()
 process the fusion. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_subscribe (struct SL_CameraIdentifier *uuid, struct SL_CommunicationParameters *params, struct SL_Vector3 *pose_translation, struct SL_Quaternion *pose_rotation)
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_image (void *mat, struct SL_CameraIdentifier *uuid, int width, int height)
 Returns the current sl_VIEW_LEFT of the specified camera, the data is synchronized. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_measure (void *mat, struct SL_CameraIdentifier *uuid, enum SL_MEASURE measure, int width, int height)
 Returns the current measure of the specified camera, the data is synchronized. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_unsubscribe (struct SL_CameraIdentifier *uuid)
 Remove the specified camera from data provider. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_update_pose (struct SL_CameraIdentifier *uuid, struct SL_Vector3 *pose_translation, struct SL_Quaternion *pose_rotation)
 
INTERFACE_API enum SL_SENDER_ERROR_CODE sl_fusion_get_sender_state (struct SL_CameraIdentifier *uuid)
 
INTERFACE_API void sl_fusion_read_configuration_file (char json_config_filename[256], enum SL_COORDINATE_SYSTEM coord_system, enum SL_UNIT unit, struct SL_FusionConfiguration *configs, int *nb_cameras)
 Read a Configuration JSON file to configure a fusion process. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_body_tracking (struct SL_BodyTrackingFusionParameters *params)
 enables Object detection fusion module More...
 
INTERFACE_API void sl_fusion_disable_body_tracking ()
 Disable the object detection module.
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_bodies (struct SL_Bodies *bodies, struct SL_BodyTrackingFusionRuntimeParameters *rt, struct SL_CameraIdentifier uuid)
 retrieves a list of bodies (in SL_Bodies class type) seen by all cameras and merged as if it was seen by a single super-camera. More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_get_process_metrics (struct SL_FusionMetrics *metrics)
 get the stats of a given camera in the Fusion API side It can be the received FPS, drop frame, latency, etc More...
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_positional_tracking (struct SL_PositionalTrackingFusionParameters *params)
 enable positional tracking fusion. More...
 
INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_position (struct SL_PoseData *pose, enum SL_REFERENCE_FRAME reference_frame, enum SL_UNIT unit, struct SL_CameraIdentifier *uuid, enum SL_POSITION_TYPE retrieve_type)
 Get the Fused Position of the camera system. More...
 
INTERFACE_API struct SL_FusedPositionalTrackingStatussl_fusion_get_fused_positional_tracking_status ()
 Get the current status of fused position. More...
 
INTERFACE_API void sl_fusion_disable_positional_tracking ()
 disable the positional tracking
 
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_ingest_gnss_data (struct SL_GNSSData *gnss_data, bool radian)
 Add GNSS that will be used by fusion for computing fused pose. More...
 
INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_current_gnss_data (struct SL_GNSSData *data, bool radian)
 returns the current GNSS data More...
 
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_geo_pose (struct SL_GeoPose *pose, bool radian)
 returns the current GeoPose More...
 
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_geo_to_camera (struct SL_LatLng *in, struct SL_PoseData *out, bool radian)
 Convert latitude / longitude into position in sl::Fusion coordinate system. More...
 
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_camera_to_geo (struct SL_PoseData *in, struct SL_GeoPose *out, bool radian)
 returns the current GeoPose More...
 
INTERFACE_API unsigned long long sl_fusion_get_current_timestamp ()
 returns the current timestamp More...
 
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_current_gnss_calibration_std (float *yaw_std, struct SL_Vector3 *position_std)
 Get the current calibration uncertainty defined during calibration process. More...
 
INTERFACE_API void sl_fusion_get_geo_tracking_calibration (struct SL_Vector3 *translation, struct SL_Quaternion *rotation)
 Get the calibration found between VIO and GNSS. More...
 
INTERFACE_API void sl_fusion_close ()
 Close Multi Camera instance.
 
INTERFACE_API void * sl_mat_create_new (int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem)
 Creates a matrix with the given resolution. More...
 
INTERFACE_API void * sl_mat_create_new_empty ()
 Creates an empty matrix. More...
 
INTERFACE_API bool sl_mat_is_init (void *ptr)
 Returns whether the matrix is initialized or not. More...
 
INTERFACE_API void sl_mat_free (void *ptr, enum SL_MEM mem)
 Frees the memory of the matrix. More...
 
INTERFACE_API void sl_mat_get_infos (void *ptr, char *buffer)
 Returns the information about the matrix into a string. More...
 
INTERFACE_API int sl_mat_get_value_uchar (void *ptr, int col, int row, unsigned char *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C1. More...
 
INTERFACE_API int sl_mat_get_value_uchar2 (void *ptr, int col, int row, struct SL_Uchar2 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C2. More...
 
INTERFACE_API int sl_mat_get_value_uchar3 (void *ptr, int col, int row, struct SL_Uchar3 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C3. More...
 
INTERFACE_API int sl_mat_get_value_uchar4 (void *ptr, int col, int row, struct SL_Uchar4 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C4. More...
 
INTERFACE_API int sl_mat_get_value_float (void *ptr, int col, int row, float *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C1. More...
 
INTERFACE_API int sl_mat_get_value_float2 (void *ptr, int col, int row, struct SL_Vector2 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C2. More...
 
INTERFACE_API int sl_mat_get_value_float3 (void *ptr, int col, int row, struct SL_Vector3 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C3. More...
 
INTERFACE_API int sl_mat_get_value_float4 (void *ptr, int col, int row, struct SL_Vector4 *value, enum SL_MEM mem)
 Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C4. More...
 
INTERFACE_API int sl_mat_set_value_uchar (void *ptr, int col, int row, unsigned char value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C1. More...
 
INTERFACE_API int sl_mat_set_value_uchar2 (void *ptr, int col, int row, struct SL_Uchar2 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C2. More...
 
INTERFACE_API int sl_mat_set_value_uchar3 (void *ptr, int col, int row, struct SL_Uchar3 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C3. More...
 
INTERFACE_API int sl_mat_set_value_uchar4 (void *ptr, int col, int row, struct SL_Uchar4 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C4. More...
 
INTERFACE_API int sl_mat_set_value_float (void *ptr, int col, int row, float value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C1. More...
 
INTERFACE_API int sl_mat_set_value_float2 (void *ptr, int col, int row, struct SL_Vector2 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C2. More...
 
INTERFACE_API int sl_mat_set_value_float3 (void *ptr, int col, int row, struct SL_Vector3 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C3. More...
 
INTERFACE_API int sl_mat_set_value_float4 (void *ptr, int col, int row, struct SL_Vector4 value, enum SL_MEM mem)
 Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C4. More...
 
INTERFACE_API int sl_mat_set_to_uchar (void *ptr, unsigned char value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_U8_C1 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_uchar2 (void *ptr, struct SL_Uchar2 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_U8_C2 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_uchar3 (void *ptr, struct SL_Uchar3 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_U8_C3 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_uchar4 (void *ptr, struct SL_Uchar4 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_U8_C4 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_float (void *ptr, float value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_F32_C1 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_float2 (void *ptr, struct SL_Vector2 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_F32_C2 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_float3 (void *ptr, struct SL_Vector3 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_F32_C3 with the given value. More...
 
INTERFACE_API int sl_mat_set_to_float4 (void *ptr, struct SL_Vector4 value, enum SL_MEM mem)
 Fills the matrix of type SL_MAT_TYPE_F32_C4 with the given value. More...
 
INTERFACE_API int sl_mat_update_cpu_from_gpu (void *ptr)
 Copies data from the GPU to the CPU, if possible. More...
 
INTERFACE_API int sl_mat_update_gpu_from_cpu (void *ptr)
 Copies data from the CPU to the GPU, if possible. More...
 
INTERFACE_API int sl_mat_copy_to (void *ptr, void *ptr_dest, enum SL_COPY_TYPE cpy_type)
 Copies data from this matrix to another matrix (deep copy). More...
 
INTERFACE_API int sl_mat_read (void *ptr, const char *file_path)
 Reads an image from a file. More...
 
INTERFACE_API int sl_mat_write (void *ptr, const char *file_path)
 Writes the Mat into a file as an image. Only works if Mat has access to MEM_CPU. More...
 
INTERFACE_API int sl_mat_get_width (void *ptr)
 Returns the width of the matrix. More...
 
INTERFACE_API int sl_mat_get_height (void *ptr)
 Returns the height of the matrix. More...
 
INTERFACE_API int sl_mat_get_channels (void *ptr)
 Returns the number of values stored in one pixel. More...
 
INTERFACE_API int sl_mat_get_memory_type (void *ptr)
 Gets the type of memory (CPU and/or GPU). More...
 
INTERFACE_API int sl_mat_get_data_type (void *ptr)
 Returns the format of the matrix. More...
 
INTERFACE_API int sl_mat_get_pixel_bytes (void *ptr)
 Returns the size of one pixel in bytes. More...
 
INTERFACE_API int sl_mat_get_step (void *ptr, enum SL_MEM mem)
 Returns the memory step in number of elements (size in one pixel row). More...
 
INTERFACE_API int sl_mat_get_step_bytes (void *ptr, enum SL_MEM mem)
 Returns the memory step in bytes (size of one pixel row). More...
 
INTERFACE_API int sl_mat_get_width_bytes (void *ptr)
 Returns the size of a row in bytes. More...
 
INTERFACE_API bool sl_mat_is_memory_owner (void *ptr)
 Returns whether the matrix is the owner of the memory it accesses. More...
 
INTERFACE_API struct SL_Resolution sl_mat_get_resolution (void *ptr)
 Returns the resolution (width and height) of the matrix. More...
 
INTERFACE_API void sl_mat_alloc (void *ptr, int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem)
 Allocates memory for the matrix. More...
 
INTERFACE_API int sl_mat_set_from (void *ptr, void *ptr_source, enum SL_COPY_TYPE copy_type)
 Copies data from another matrix into this one (deep copy). More...
 
INTERFACE_API int * sl_mat_get_ptr (void *ptr, enum SL_MEM mem)
 Gets a pointer to the matrix. More...
 
INTERFACE_API int sl_mat_clone (void *ptr, void *ptr_source)
 Duplicates a matrix by copying all its data into a new one (deep copy). More...
 
INTERFACE_API void sl_mat_swap (void *ptr_1, void *ptr_2)
 Swaps the content of the provided matrix (only swaps the pointers, no data copy). More...
 

Function Documentation

◆ sl_unload_instance()

INTERFACE_API void sl_unload_instance ( int  camera_id)

Forces unload of one instance.

Parameters
camera_id: id of the instance to unload.

◆ sl_find_usb_device()

INTERFACE_API bool sl_find_usb_device ( enum USB_DEVICE  device)

Checks usb devices connected. param device : type of device to find.

Returns
true if connected.

◆ sl_create_camera()

INTERFACE_API bool sl_create_camera ( int  camera_id)

Creates a camera with resolution mode, fps and id for linux.

Parameters
camera_id: id of the camera to be added.
verbose: Enable verbose mode.
Returns
true if the camera has been created successfully.

◆ sl_is_opened()

INTERFACE_API bool sl_is_opened ( int  camera_id)

Reports if the camera has been successfully opened.

Parameters
camera_id: Id of the camera.
Returns
true if the ZED camera is already setup, otherwise false.

◆ sl_open_camera()

INTERFACE_API int sl_open_camera ( int  camera_id,
struct SL_InitParameters init_parameters,
const unsigned int  serial_number,
const char *  path_svo,
const char *  ip,
int  stream_port,
const char *  output_file,
const char *  opt_settings_path,
const char *  opencv_calib_path 
)

Opens the ZED camera from the provided SL_InitParameters.

Parameters
camera_id: Id of the camera to open.
init_parameters: A structure containing all the initial parameters. Default: a preset of SL_InitParameters.
serial_number: Serial number of the camera to open.
path_svo: Filename of the svo to read (for SVO input).
ip: IP of the camera to open (for Stream input).
stream_port: Port of the camera to open (for Stream input).
output_file: ZED SDK verbose log file. Redirect the SDK verbose message to the file.
opt_settings_path[optional]: Settings path.
opencv_calib_path[optional]: openCV calibration file.
Returns
An error code giving information about the internal process. If SL_ERROR_CODE_SUCCESS (0) is returned, the camera is ready to use. Every other code indicates an error and the program should be stopped.

◆ sl_start_publishing()

INTERFACE_API enum SL_ERROR_CODE sl_start_publishing ( int  camera_id,
struct SL_CommunicationParameters comm_params 
)

Set this camera as a data provider for the Fusion module.

Metadata is exchanged with the Fusion.

Parameters
camera_id: Id of the camera instance.
configuration: A structure containing all the initial parameters. Default: a preset of SL_CommunicationParameters.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_stop_publishing()

INTERFACE_API enum SL_ERROR_CODE sl_stop_publishing ( int  camera_id)

Set this camera as normal camera(without data providing).
Stop to send camera data to fusion.

Returns
SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise

◆ sl_get_cuda_context()

INTERFACE_API CUcontext sl_get_cuda_context ( int  camera_id)

Gets the Camera-created CUDA context for sharing it with other CUDA-capable libraries.

This can be useful for sharing GPU memories.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_init_parameters()

INTERFACE_API struct SL_InitParameters* sl_get_init_parameters ( int  camera_id)

Returns the SL_InitParameters used.

It corresponds to the structure given as argument to the sl_open_camera() function.

Parameters
camera_id: Id of the camera instance.
Returns
SL_InitParameters containing the parameters used to initialize the camera.

◆ sl_get_runtime_parameters()

INTERFACE_API struct SL_RuntimeParameters* sl_get_runtime_parameters ( int  camera_id)

Returns the SL_RuntimeParameters used.

It corresponds to the structure given as argument to the sl_grab() function.

Parameters
camera_id: id of the camera instance.
Returns
SL_RuntimeParameters containing the parameters that define the behavior of the sl_grab function.

◆ sl_get_positional_tracking_parameters()

INTERFACE_API struct SL_PositionalTrackingParameters* sl_get_positional_tracking_parameters ( int  camera_id)

Returns the SL_PositionalTrackingParameters used.

It corresponds to the structure given as argument to the sl_enable_positional_tracking() method.

Parameters
camera_id: Id of the camera instance.
Returns
SL_PositionalTrackingParameters containing the parameters used for positional tracking initialization.

◆ sl_close_camera()

INTERFACE_API void sl_close_camera ( int  camera_id)

Close an opened camera and disable the textures.

Parameters
camera_id: Id of the camera instance.

◆ sl_set_region_of_interest()

INTERFACE_API int sl_set_region_of_interest ( int  camera_id,
void *  roi_mask,
bool  module[SL_MODULE_LAST] 
)

Defines a region of interest to focus on for all the SDK, discarding other parts.

Parameters
camera_id: Id of the camera instance.
roi_mask: The matrix defining the requested region of interest, pixels lower than 127 will be discarded from all modules: depth, positional tracking, etc. If empty, set all pixels as valid. The mask can be either at lower or higher resolution than the current images.
moduleApply the ROI to a list of SDK module, all by default.
Returns
An SL_ERROR_CODE if something went wrong.
Note
The function support SL_MAT_TYPE_U8_C1 / SL_MAT_TYPE_UU8_C3 / SL_MAT_TYPE_UU8_C4 images type.

◆ sl_get_region_of_interest()

INTERFACE_API int sl_get_region_of_interest ( int  camera_id,
void *  roi_mask,
int  width,
int  height,
enum SL_MODULE  module 
)

Get the previously set or computed region of interest.

Parameters
camera_id: Id of the camera instance.
roi_maskThe Mat returned.
image_sizeThe optional size of the returned mask.
moduleSpecify which module to get the ROI.
Returns
An SL_ERROR_CODE if something went wrong.

◆ sl_start_region_of_interest_auto_detection()

INTERFACE_API int sl_start_region_of_interest_auto_detection ( int  camera_id,
struct SL_RegionOfInterestParameters roi_param 
)

Start the auto detection of a region of interest to focus on for all the SDK, discarding other parts. This detection is based on the general motion of the camera combined with the motion in the scene. The camera must move for this process, an internal motion detector is used, based on the Positional Tracking module. It requires a few hundreds frames of motion to compute the mask.

Parameters
roi_paramThe SL_RegionOfInterestParameters defining parameters for the detection
Note
This module is expecting a static portion, typically a fairly close vehicle hood at the bottom of the image. This module may not work correctly or detect incorrect background area, especially with slow motion, if there's no static element. This module work asynchronously, the status can be obtained using sl_get_region_of_interest_auto_detection_status(), the result is either auto applied, or can be retrieve using sl_get_region_of_interest function.
Returns
An SL_ERROR_CODE if something went wrong.

◆ sl_get_region_of_interest_auto_detection_status()

INTERFACE_API enum SL_REGION_OF_INTEREST_AUTO_DETECTION_STATE sl_get_region_of_interest_auto_detection_status ( int  camera_id)

Return the status of the automatic Region of Interest Detection The automatic Region of Interest Detection is enabled by using sl_start_region_of_interest_auto_detection.

Parameters
camera_id: Id of the camera instance.
Returns
SL_REGION_OF_INTEREST_AUTO_DETECTION_STATE the status

◆ sl_grab()

INTERFACE_API int sl_grab ( int  camera_id,
struct SL_RuntimeParameters runtime 
)

Grabs the latest images from the camera.

Parameters
camera_id: Id of the camera instance.
runtime: A structure containing all the runtime parameters. Default: a preset of SL_RuntimeParameters.
Returns
An error code giving information about the internal process. SL_ERROR_CODE_SUCCESS if the method succeeded.

◆ sl_get_device_list()

INTERFACE_API void sl_get_device_list ( struct SL_DeviceProperties  device_list[MAX_CAMERA_PLUGIN],
int *  nb_devices 
)

Lists all the connected devices with their associated information.

This method lists all the cameras available and provides their serial number, models and other information.

Parameters
device_list[Out] : The devices properties for each connected camera.
nb_devices[Out] : The number of cameras connected.

◆ sl_get_streaming_device_list()

INTERFACE_API void sl_get_streaming_device_list ( struct SL_StreamingProperties  streaming_device_list[MAX_CAMERA_PLUGIN],
int *  nb_devices 
)

List all the streaming devices with their associated information.

Parameters
device_list[Out] : The devices properties for each connected camera.
nb_devices[Out]: The number of cameras connected.
Returns
The streaming properties for each connected camera.

◆ sl_reboot()

INTERFACE_API int sl_reboot ( int  sn,
bool  full_reboot 
)

Performs a hardware reset of the ZED 2 and the ZED 2i.

Parameters
sn: Serial number of the camera to reset, or 0 to reset the first camera detected.
fullReboot: Perform a full reboot (sensors and video modules) if true, otherwise only the video module will be rebooted.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine.
SL_ERROR_CODE_CAMERA_NOT_DETECTED if no camera was detected.
SL_ERROR_CODE_FAILURE otherwise.
Note
This method only works for ZED 2, ZED 2i, and newer camera models.

◆ sl_enable_recording()

INTERFACE_API int sl_enable_recording ( int  camera_id,
const char *  filename,
enum SL_SVO_COMPRESSION_MODE  compression_mode,
unsigned int  bitrate,
int  target_fps,
bool  transcode 
)

Creates a file for recording the ZED's output into a .SVO or .AVI video.

An SVO is Stereolabs' own format designed for the ZED. It holds the video feed with timestamps as well as info about the camera used to record it.

Parameters
camera_id: Id of the camera instance.
filename: Filename of the SVO file.
compression_mode: Compression mode. It can be one for the SL_SVO_COMPRESSION_MODE enum.
bitrate: overrides default bitrate of the SVO file, in KBits/s. Only works if SL_SVO_COMPRESSION_MODE is H264 or H265.
target_fps: Defines the target framerate for the recording module.
transcode: In case of streaming input, if set to false, it will avoid decoding/re-encoding and convert directly streaming input to a SVO file. This saves a encoding session and can be especially useful on NVIDIA Geforce cards where the number of encoding session is limited.
Returns
An SL_ERROR_CODE that defines if SVO file was successfully created and can be filled with images.

◆ sl_get_recording_status()

INTERFACE_API struct SL_RecordingStatus* sl_get_recording_status ( int  camera_id)

Get the recording information.

Returns
The recording state structure. For more details, see SL_RecordingStatus.

◆ sl_disable_recording()

INTERFACE_API void sl_disable_recording ( int  camera_id)

Disables the recording initiated by sl_enable_recording() and closes the generated file.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_recording_parameters()

INTERFACE_API struct SL_RecordingParameters* sl_get_recording_parameters ( int  camera_id)

Returns the SL_RecordingParameters used.

It corresponds to the structure given as argument to the sl_enable_recording() function.

Parameters
camera_id: Id of the camera instance.
Returns
SL_RecordingParameters containing the parameters used for recording initialization.

◆ sl_pause_recording()

INTERFACE_API void sl_pause_recording ( int  camera_id,
bool  status 
)

Pauses or resumes the recording.

Parameters
camera_id: Id of the camera instance.
status: If true, the recording is paused. If false, the recording is resumed.

◆ sl_ingest_data_into_svo()

INTERFACE_API enum SL_ERROR_CODE sl_ingest_data_into_svo ( int  camera_id,
struct SL_SVOData data 
)

Ingests SL_SVOData in a SVO file.

Parameters
camera_id: Id of the camera instance.
data: Data to ingest in the SVO file.
Returns
sl_ERROR_CODE_SUCCESS in case of success, sl_ERROR_CODE_FAILURE otherwise.
Note
The method works only if the camera is recording.

◆ sl_get_svo_data_size()

INTERFACE_API int sl_get_svo_data_size ( int  camera_id,
char  key[128],
unsigned long long  ts_begin,
unsigned long long  ts_end 
)

Gets the size of data available for a given key. Must be called before sl_retrieve_svo_data to initialize the array at the correct size.

Parameters
camera_id: Id of the camera instance.
key: The key of the SVOData that is going to be retrieved.
ts_begin: The beginning of the range.
ts_end: The end of the range.
Returns
The number of data available for this key.
Note
The method will always return -1 if not in SVO mode.

◆ sl_retrieve_svo_data()

INTERFACE_API enum SL_ERROR_CODE sl_retrieve_svo_data ( int  camera_id,
char  key[128],
int  nb_data,
struct SL_SVOData data,
unsigned long long  ts_begin,
unsigned long long  ts_end 
)

Retrieves SVOData from an SVO file. The user is reponsible for correctly allocating the size of the data array using sl_get_svo_data_size.

Parameters
camera_id: Id of the camera instance.
nb_data: Size of the array of data.
data: The map to be filled with SVOData objects, with timestamps as keys.
ts_begin: The beginning of the range.
ts_end: The end of the range.
Returns
sl_ERROR_CODE_SUCCESS in case of success, sl_ERROR_CODE_FAILURE otherwise.
Note
The method will return sl_ERROR_CODE_FAILURE if not in SVO mode.
Warning
You need to call sl_get_svo_data_size for the key before calling this method to correctly retrieve the data.

◆ sl_get_svo_data_keys_size()

INTERFACE_API int sl_get_svo_data_keys_size ( int  camera_id)

Gets the number of external channels that can be retrieved from the SVO file.

Parameters
camera_id: Id of the camera instance.
Returns
the number of keys available.
Note
The method will return 0 if not in SVO mode.

◆ sl_get_svo_data_keys()

INTERFACE_API void sl_get_svo_data_keys ( int  camera_id,
int  nb_keys,
char *  keys[128] 
)

Gets the external channels that can be retrieved from the SVO file. The user is reponsible for correctly allocating the size of the keys array using sl_get_svo_data_keys_size.

Parameters
camera_id: Id of the camera instance.
nb_keys: number of keys.
[Out]keys : List of available keys.
Note
The method will not fill the keys array if not in SVO mode.

◆ sl_enable_positional_tracking()

INTERFACE_API int sl_enable_positional_tracking ( int  camera_id,
struct SL_PositionalTrackingParameters tracking_param,
const char *  area_file_path 
)

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.

Parameters
camera_id: Id of the camera instance.
tracking_param: A structure containing all the specific parameters for the positional tracking. Default: a preset of SL_PositionalTrackingParameters.
area_file_path: .area localization file that describes the surroundings, saved from a previous tracking session.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_disable_positional_tracking()

INTERFACE_API void sl_disable_positional_tracking ( int  camera_id,
const char *  area_file_path 
)

Disables the positional tracking.

Parameters
camera_id: Id of the camera instance.
area_file_path: If set, saves the spatial memory into an '.area' file.

◆ sl_save_area_map()

INTERFACE_API int sl_save_area_map ( int  camera_id,
const char *  area_file_path 
)

Saves the current area learning file. The file will contain spatial memory data generated by the tracking.

Parameters
camera_id: Id of the camera instance.
area_file_path: Save the spatial memory database in an '.area' file.
Returns
SL_ERROR_CODE_FAILURE if the area_file_path file wasn't found, SL_ERROR_CODE_SUCCESS otherwise.

◆ sl_get_area_export_state()

INTERFACE_API int sl_get_area_export_state ( int  camera_id)

Returns the state of the spatial memory export process.

As sl_save_area_map only starts the exportation, this method allows you to know when the exportation finished or if it failed.

Parameters
camera_id: Id of the camera instance.
Returns
The current state of the spatial memory export process

◆ sl_set_svo_position()

INTERFACE_API void sl_set_svo_position ( int  camera_id,
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 sl_grab() will read the provided frame number.

Parameters
camera_id: Id of the camera instance.
frame_number: The number of the desired frame to be decoded.

◆ sl_get_camera_fps()

INTERFACE_API float sl_get_camera_fps ( int  camera_id)

Returns the camera FPS.

Parameters
camera_id: Id of the camera instance.
Returns
The current frame rate.

◆ sl_get_current_fps()

INTERFACE_API float sl_get_current_fps ( int  camera_id)

Returns the current FPS.

Parameters
camera_id: Id of the camera instance.
Returns
The current frame rate.

◆ sl_get_width()

int INTERFACE_API sl_get_width ( int  camera_id)

Returns the width of the current image.

Parameters
camera_id: Id of the camera instance.
Returns
Width of the image.

◆ sl_get_height()

int INTERFACE_API sl_get_height ( int  camera_id)

Returns the height of the current image.

Parameters
camera_id: Id of the camera instance.
Returns
Height of the image.

◆ sl_get_confidence_threshold()

INTERFACE_API int sl_get_confidence_threshold ( int  camera_id)

Gets the current confidence threshold value for the disparity map (and by extension the depth map).

Parameters
camera_id: id of the camera instance.
Returns
The confidence threshold. -1 if failure.

◆ sl_get_camera_information()

INTERFACE_API struct SL_CameraInformation* sl_get_camera_information ( int  camera_id,
int  res_width,
int  res_height 
)

Returns the SL_CameraInformation associated the camera.

To ensure accurate calibration, it is possible to specify a custom resolution as a parameter when obtaining scaled information, as calibration parameters are resolution-dependent.

Parameters
camera_id: Id of the camera instance.
res_width: You can specify a size different from default image size to get the scaled camera information.
res_height: You can specify a size different from default image size to get the scaled camera information.
Returns
SL_CameraInformation containing the calibration parameters of the ZED, as well as serial number and firmware version.

◆ sl_update_self_calibration()

INTERFACE_API void sl_update_self_calibration ( int  camera_id)

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.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_calibration_parameters()

INTERFACE_API struct SL_CalibrationParameters* sl_get_calibration_parameters ( int  camera_id,
bool  raw_params 
)

Gets the Calibration Parameters.

Parameters
camera_id: id of the camera instance.
r_params: if true, returns Intrinsic and Extrinsic stereo parameters for original images (unrectified/distorded), else returns parameters for rectified/undistorded images.
Returns
Structure containing Intrinsic and Extrinsic stereo parameters

◆ sl_get_sensors_configuration()

INTERFACE_API struct SL_SensorsConfiguration* sl_get_sensors_configuration ( int  camera_id)

Gets the Sensors configuration.

Parameters
camera_id: id of the camera instance.
Returns
Structure containing information about all the sensors available in the current device.

◆ sl_get_camera_imu_transform()

INTERFACE_API void sl_get_camera_imu_transform ( int  camera_id,
struct SL_Vector3 translation,
struct SL_Quaternion rotation 
)

Gets the IMU to the left camera transform matrix.

Note
This function is only effective if the camera has a model other than a SL_MODEL_ZED, which does not contains internal sensors.
Parameters
camera_id: Id of the camera instance.
translation: Translation between IMU frame and camera frame.
rotation: Rotation between IMU frame and camera frame.
Returns
SL_ERROR_CODE_SUCCESS if sensors data have been extracted.
SL_ERROR_CODE_SENSORS_NOT_AVAILABLE if the camera model is a SL_MODEL_ZED.
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct but the sensors module is not opened.
SL_ERROR_CODE_INVALID_FUNCTION_PARAMETERS if the reference_time is not valid.

◆ sl_get_input_type()

INTERFACE_API int sl_get_input_type ( int  camera_id)

Gets the input type (see SL_INPUT_TYPE).

Parameters
camera_id: id of the camera instance.
Returns
The input type.

◆ sl_get_zed_serial()

INTERFACE_API int sl_get_zed_serial ( int  camera_id)

Gets the ZED Serial Number.

Parameters
camera_id: id of the camera instance.
Returns
The serial number of the camera.

◆ sl_get_camera_firmware()

INTERFACE_API int sl_get_camera_firmware ( int  camera_id)

Gets the ZED camera current firmware version.

Parameters
camera_id: Id of the camera instance.
Returns
The firmware of the camera.

◆ sl_get_sensors_firmware()

INTERFACE_API int sl_get_sensors_firmware ( int  camera_id)

Gets the sensor module current firmware version.

Parameters
camera_id: Id of the camera instance.
Returns
The firmware version of the sensor module, 0 if no sensors are available.

◆ sl_get_camera_model()

INTERFACE_API int sl_get_camera_model ( int  camera_id)

Gets the ZED Camera model (see SL_MODEL).

Parameters
camera_id: id of the camera instance.
Returns
The ZED Camera model.

◆ sl_get_image_timestamp()

INTERFACE_API unsigned long long sl_get_image_timestamp ( int  camera_id)

Get the timestamp at the time the frame has been extracted from USB stream.

Note
It should be called after a sl_grab().
Parameters
camera_id: Id of the camera instance.
Returns
The camera timestamp.

◆ sl_get_current_timestamp()

INTERFACE_API unsigned long long sl_get_current_timestamp ( int  camera_id)

Get the current timestamp at the time the function is called.

Can be compared to the camera timestamp for synchronization.

Parameters
camera_id: Id of the camera instance.
Returns
The current timestamp.

◆ sl_get_svo_number_of_frames()

INTERFACE_API int sl_get_svo_number_of_frames ( int  camera_id)

Returns the number of frames in the SVO file.

Parameters
camera_id: Id of the camera instance.
Returns
The total number of frames in the SVO file. -1 if the SDK is not reading a SVO.

◆ sl_is_camera_setting_supported()

INTERFACE_API bool sl_is_camera_setting_supported ( int  camera_id,
enum SL_VIDEO_SETTINGS  setting 
)

Test if the video setting is supported by the camera.

Parameters
camera_id: Id of the camera instance.
setting: The video setting to test
Returns
true if the SL_VIDEO_SETTINGS is supported by the camera, false otherwise

◆ sl_set_camera_settings()

INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings ( int  camera_id,
enum SL_VIDEO_SETTINGS  mode,
int  value 
)

Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.).

Parameters
camera_id: Id of the camera instance.
mode: The setting to be set.
value: The value to set.
Returns
SL_ERROR_CODE to indicate if the function was successful.
Note
The function works only if the camera is open in LIVE or STREAM mode.

◆ sl_set_camera_settings_min_max()

INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings_min_max ( int  camera_id,
enum SL_VIDEO_SETTINGS  mode,
int  min,
int  max 
)

Sets the range values of the requested camera setting (gain, brightness, hue, exposure, etc.). Works for the following settings: SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_EXPOSURE_TIME_RANGE SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_ANALOG_GAIN_RANGE SL_VIDEO_SETTINGS SL_VIDEO_SETTINGS_AUTO_DIGITAL_GAIN_RANGE.

Parameters
camera_id: Id of the camera instance.
mode: The setting to be set.
min: The min value to set.
max: The max value to set.
Returns
SL_ERROR_CODE to indicate if the function was successful.
Note
The function works only if the camera is open in LIVE or STREAM mode.

◆ sl_set_roi_for_aec_agc()

INTERFACE_API enum SL_ERROR_CODE sl_set_roi_for_aec_agc ( int  camera_id,
enum SL_SIDE  side,
struct SL_Rect roi,
bool  reset 
)

Sets the region of interest for automatic exposure/gain computation.

Parameters
camera_id: Id of the camera instance.
side: SL_SIDE on which to be applied for AEC/AGC computation.
roi: SL_Rect that defines the target to be applied for AEC/AGC computation. Must be given according to camera resolution.
reset: Cancel the manual ROI and reset it to the full image.
Returns
SL_ERROR_CODE to indicate if the function was successful.
Note
The function works only if the camera is open in LIVE or STREAM mode.

◆ sl_get_camera_settings()

INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings ( int  c_id,
enum SL_VIDEO_SETTINGS  mode,
int *  value 
)

Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.).

Parameters
camera_id: Id of the camera instance.
mode: Setting to be retrieved (see SL_VIDEO_SETTINGS).
value: The requested setting value.
Returns
SL_ERROR_CODE to indicate if the function was successful. If successful, setting will be filled with the corresponding value.
Note
The function works only if the camera is open in LIVE or STREAM mode.
Settings are not exported in the SVO file format.

◆ sl_get_camera_settings_min_max()

INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings_min_max ( int  c_id,
enum SL_VIDEO_SETTINGS  mode,
int *  minvalue,
int *  maxvalue 
)

Returns the current range of the requested camera setting (setting with range value).

Parameters
camera_id: Id of the camera instance.
mode: Setting to be retrieved (see SL_VIDEO_SETTINGS).
value: The requested setting value.
Returns
SL_ERROR_CODE to indicate if the function was successful. If successful, setting will be filled with the corresponding value.
Note
The function works only if the camera is open in LIVE or STREAM mode.
Settings are not exported in the SVO file format.

◆ sl_get_roi_for_aec_agc()

INTERFACE_API enum SL_ERROR_CODE sl_get_roi_for_aec_agc ( int  id,
enum SL_SIDE  side,
struct SL_Rect roi 
)

Gets the region of interest for automatic exposure/gain computation.

Parameters
camera_id: Id of the camera instance.
side: SL_SIDE on which to get the ROI from.
roi[Out] : Region of interest.
Returns
SL_ERROR_CODE_SUCCESS if ROI has been applied. Other SL_ERROR_CODE otherwise.
Note
The function works only if the camera is open in LIVE or STREAM mode.
Settings are not exported in the SVO file format.

◆ sl_get_depth_min_range_value()

INTERFACE_API float sl_get_depth_min_range_value ( int  camera_id)

Gets the depth min value from InitParameters (see SL_InitParameters::depth_minimum_distance).

Parameters
camera_id: id of the camera instance.
Returns
The min depth value available. -1 if failure.

◆ sl_get_depth_max_range_value()

INTERFACE_API float sl_get_depth_max_range_value ( int  camera_id)

Gets the depth max value from InitParameters (see SL_InitParameters::depth_maximum_distance).

Parameters
camera_id: id of the camera instance.
Returns
The max depth value available. -1 if failure.

◆ sl_get_current_min_max_depth()

INTERFACE_API int sl_get_current_min_max_depth ( int  camera_id,
float *  min,
float *  max 
)

Gets the current range of perceived depth.

Parameters
camera_id: Id of the camera instance.
min: [Out] Minimum depth detected (in selected SL_UNIT)
max: [Out] Maximum depth detected (in selected SL_UNIT).
Returns
SL_ERROR_CODE_SUCCESS if values have been extracted. Other SL_ERROR_CODE otherwise.

◆ sl_get_number_zed_connected()

INTERFACE_API int sl_get_number_zed_connected ( )

Gets the number of zed connected.

Returns
The number of Zed cameras connected.

◆ sl_get_sdk_version()

INTERFACE_API char* sl_get_sdk_version ( )

Returns the version of the currently installed ZED SDK.

Returns
The ZED SDK version installed.

◆ sl_convert_coordinate_system()

INTERFACE_API int sl_convert_coordinate_system ( struct SL_Quaternion rotation,
struct SL_Vector3 translation,
enum SL_COORDINATE_SYSTEM  coord_system_src,
enum SL_COORDINATE_SYSTEM  coord_system_dest 
)

Change the coordinate system of a transform matrix.

Parameters
rotation[In, Out] : rotation to transform.
translation[In, Out] : translation to transform.
coord_system_src: the current coordinate system of the translation/rotation.
coord_system_destthe destination coordinate system for the translation/rotation.

◆ sl_get_svo_position()

INTERFACE_API int sl_get_svo_position ( int  camera_id)

Returns the current playback position in the SVO file.

Parameters
camera_id: Id of the camera instance.
Returns
The current frame position in the SVO file. Returns -1 if the SDK is not reading an SVO.

◆ sl_get_svo_position_at_timestamp()

INTERFACE_API int sl_get_svo_position_at_timestamp ( int  camera_id,
unsigned long long  timestamp 
)

Retrieves the frame index within the SVO file corresponding to the provided timestamp.

Parameters
camera_id: Id of the camera instance.
timestampThe target timestamp for which the frame index is to be determined.
Returns
The frame index within the SVO file that aligns with the given timestamp. Returns -1 if the timestamp falls outside the bounds of the SVO file.

◆ sl_get_frame_dropped_count()

INTERFACE_API unsigned int sl_get_frame_dropped_count ( int  camera_id)

Gets the number of frames dropped since sl_grab() was called for the first time. Based on camera timestamps and an FPS comparison.

Parameters
camera_id: Id of the camera instance.
Returns
The number of frames dropped since the first sl_grab() call.

◆ sl_is_positional_tracking_enabled()

INTERFACE_API bool sl_is_positional_tracking_enabled ( int  camera_id)

Tells if the tracking module is enabled.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_position_at_target_frame()

INTERFACE_API int sl_get_position_at_target_frame ( int  camera_id,
struct SL_Quaternion rotation,
struct SL_Vector3 position,
struct SL_Quaternion target_quaternion,
struct SL_Vector3 target_translation,
enum SL_REFERENCE_FRAME  reference_frame 
)

Gets the current position of the camera and state of the tracking, with an optional offset to the tracking frame.

Parameters
camera_id: Id of the camera instance.
rotation: Quaternion filled with the current rotation of the camera depending on its reference frame.
position: Vector filled with the current position of the camera depending on its reference frame.
target_quaternion: Rotational offset applied to the tracking frame.
target_translation: Positional offset applied to the tracking frame.
reference_frame: Reference frame for setting the rotation/position.
Returns
The current state of the tracking process (see SL_POSITIONAL_TRACKING_STATE).

◆ sl_get_position_data()

INTERFACE_API int sl_get_position_data ( int  camera_id,
struct SL_PoseData poseData,
enum SL_REFERENCE_FRAME  reference_frame 
)

Gets the current position of the camera and state of the tracking, filling a SL_PoseData struck useful for AR pass-though.

Parameters
camera_id: Id of the camera instance.
poseData: Current Pose.
reference_frame: Reference frame sor setting the rotation/position.
Returns
The current state of the tracking process (see SL_POSITIONAL_TRACKING_STATE).

◆ sl_get_position()

INTERFACE_API int sl_get_position ( int  camera_id,
struct SL_Quaternion rotation,
struct SL_Vector3 position,
enum SL_REFERENCE_FRAME  reference_frame 
)

Retrieves the estimated position and orientation of the camera in the specified reference frame.

Parameters
camera_id: Id of the camera instance.
rotation: Quaternion filled with the current rotation of the camera depending on its reference frame.
position: Vector filled with the current position of the camera depending on its reference frame.
reference_frame: Reference frame for setting the rotation/position.
Returns
The current state of the tracking process (see SL_POSITIONAL_TRACKING_STATE).

◆ sl_get_position_array()

INTERFACE_API int sl_get_position_array ( int  camera_id,
float *  pose,
enum SL_REFERENCE_FRAME  reference_frame 
)

Gets the position of the camera and the current state of the ZED Tracking as a float array (4x4).

Parameters
camera_id: id of the camera instance.
pose: pose of the camera as a float array (float[16]).
reference_frame: the reference from which you want the pose to be expressed (see SL_REFERENCE_FRAME::WORLD).
Returns
The Positional tracking state.

◆ sl_get_positional_tracking_status()

INTERFACE_API struct SL_PositionalTrackingStatus* sl_get_positional_tracking_status ( int  camera_id)

Return the current status of positional tracking module.

Returns
SL_POSITIONAL_TRACKING_STATUS current status of positional tracking module.

◆ sl_reset_positional_tracking()

INTERFACE_API int sl_reset_positional_tracking ( int  camera_id,
struct SL_Quaternion  rotation,
struct SL_Vector3  translation 
)

Resets the tracking, and re-initializes the position with the given pose.

Parameters
camera_id: Id of the camera instance.
rotation: Rotation of the camera in the world frame when the function is called.
translation: Position of the camera in the world frame when the function is called.
Returns
SL_ERROR_CODE_SUCCESS if the tracking has been reset, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_reset_positional_tracking_with_offset()

INTERFACE_API int sl_reset_positional_tracking_with_offset ( int  camera_id,
struct SL_Quaternion  rotation,
struct SL_Vector3  translation,
struct SL_Quaternion  target_quaternion,
struct SL_Vector3  target_translation 
)

Resets the tracking with an offset.

Parameters
camera_id: Id of the camera instance.
rotation: Rotation of the camera in the world frame when the function is called.
translation: Position of the camera in the world frame when the function is called.
target_quaternion: Rotation offset to apply.
target_translation: Translation offset to apply.
Returns
SL_ERROR_CODE_SUCCESS if the tracking has been reset, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_set_imu_prior_orientation()

INTERFACE_API int sl_set_imu_prior_orientation ( int  camera_id,
struct SL_Quaternion  rotation 
)

Set an optional IMU orientation hint that will be used to assist the tracking during the next sl_grab().

Prior must come from a external IMU, such as the HMD orientation and should be in a time frame that's as close as possible to the camera.

Note
This function is only effective if the camera has a model other than a SL_MODEL_ZED, which does not contains internal sensors.
Parameters
rotation: Prior rotation.
Returns
SL_ERROR_CODE_SUCCESS if sensors data have been extracted.
SL_ERROR_CODE_SENSORS_NOT_AVAILABLE if the camera model is a SL_MODEL_ZED.
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct but the sensors module is not opened.
SL_ERROR_CODE_INVALID_FUNCTION_PARAMETERS if the reference_time is not valid.

◆ sl_get_imu_orientation()

INTERFACE_API int sl_get_imu_orientation ( int  camera_id,
struct SL_Quaternion quat,
enum SL_TIME_REFERENCE  time_reference 
)

Gets the rotation given by the IMU.

Note
This function is only effective if the camera has a model other than a SL_MODEL_ZED, which does not contains internal sensors.
Parameters
camera_id: id of the camera instance.
quat: [Out] Rotation from the IMU.
time_reference: time reference.
Returns
SL_ERROR_CODE_SUCCESS if sensors data have been extracted.
SL_ERROR_CODE_SENSORS_NOT_AVAILABLE if the camera model is a SL_MODEL_ZED.
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct but the sensors module is not opened.
SL_ERROR_CODE_INVALID_FUNCTION_PARAMETERS if the reference_time is not valid.

◆ sl_get_sensors_data()

INTERFACE_API int sl_get_sensors_data ( int  camera_id,
struct SL_SensorsData data,
enum SL_TIME_REFERENCE  time_reference 
)

Gets SL_SensorsData (IMU, magnetometer, barometer) at a specific time reference.

Note
This function is only effective if the camera has a model other than a SL_MODEL_ZED, which does not contains internal sensors.
Parameters
camera_id: Id of the camera instance.
data: The SL_SensorsData variable to store the data.
time_reference: Defines the reference from which you want the data to be expressed.
Returns
SL_ERROR_CODE_SUCCESS if sensors data have been extracted.
SL_ERROR_CODE_SENSORS_NOT_AVAILABLE if the camera model is a SL_MODEL_ZED.
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct but the sensors module is not opened.
SL_ERROR_CODE_INVALID_FUNCTION_PARAMETERS if the reference_time is not valid.

◆ sl_spatial_mapping_merge_chunks()

INTERFACE_API void sl_spatial_mapping_merge_chunks ( int  camera_id,
int  nb_faces,
int *  nb_vertices,
int *  nb_triangles,
int *  nb_updated_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
const int  max_submesh 
)

Consolidates the chucks from a scan. This is used to turn a lots of small meshes (which are efficient for the scanning process) into several large meshes (which are more convenient to work with).

Parameters
camera_id: id of the camera instance.
nb_faces: define the new number of faces per chunk (useful for Unity that doesn't handle chunks over 65K vertices).
nb_vertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_updated_submeshes: Number of sub-meshes.
updates_indices: List of all sub-meshes updated since the last update.
nb_vertices_tot: Total number of updated vertices in all sub-meshes.
nb_triangles_tot: Total number of updated triangles in all sub-meshes.
max_sub_mesh: Maximum number of sub-meshes.

◆ sl_enable_spatial_mapping()

INTERFACE_API int sl_enable_spatial_mapping ( int  camera_id,
struct SL_SpatialMappingParameters mapping_param 
)

Initializes and starts the spatial mapping processes.

Parameters
camera_id: Id of the camera instance.
type: Spatial mapping type (see SL_SPATIAL_MAP_TYPE).
resolution_meter: Spatial mapping resolution in meters.
max_range_meter: Maximum scanning range in meters.
save_texture: True to scan surface textures in addition to geometry.
max_memory_usage: The maximum CPU memory (in megabytes) allocated for the meshing process.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_disable_spatial_mapping()

INTERFACE_API void sl_disable_spatial_mapping ( int  camera_id)

Disables the spatial mapping process.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_spatial_mapping_parameters()

INTERFACE_API struct SL_SpatialMappingParameters* sl_get_spatial_mapping_parameters ( int  camera_id)

Returns the SL_SpatialMappingParameters used.

It corresponds to the structure given as argument to the sl_enable_spatial_mapping() method.

Parameters
camera_id: Id of the camera instance.
Returns
SL_SpatialMappingParameters containing the parameters used for spatial mapping initialization.

◆ sl_pause_spatial_mapping()

INTERFACE_API void sl_pause_spatial_mapping ( int  camera_id,
bool  status 
)

Pauses or resumes the spatial mapping processes.

Parameters
camera_id: Id of the camera instance.
status: If true, the integration is paused. If false, the spatial mapping is resumed.

◆ sl_request_mesh_async()

INTERFACE_API void sl_request_mesh_async ( int  camera_id)

Starts the spatial map generation process in a non-blocking thread from the spatial mapping process.

Parameters
camera_id: Id of the camera instance.

◆ sl_get_mesh_request_status_async()

INTERFACE_API int sl_get_mesh_request_status_async ( int  camera_id)

Returns the spatial map generation status.

Useful for knowing when to update and retrieve the mesh or the point cloud.

Parameters
camera_id: Id of the camera instance.
Returns
SL_ERROR_CODE_SUCCESS if the mesh or the point cloud is ready and not yet retrieved, otherwise SL_ERROR_CODE_FAILURE.

◆ sl_get_spatial_mapping_state()

INTERFACE_API enum SL_SPATIAL_MAPPING_STATE sl_get_spatial_mapping_state ( int  camera_id)

Returns the current spatial mapping state.

As the spatial mapping runs asynchronously, this function allows you to get reported errors or status info.

Parameters
camera_id: Id of the camera instance.
Returns
The current state of the spatial mapping process.

◆ sl_update_mesh()

INTERFACE_API int sl_update_mesh ( int  camera_id,
int *  nb_vertices_per_submesh,
int *  nb_triangles_per_submesh,
int *  nb_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
const int  max_submesh 
)

Updates the internal version of the mesh and returns the sizes of the meshes.

Parameters
camera_id: Id of the camera instance.
nb_vertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_submeshes: Number of sub-meshes.
updates_indices: List of all sub-meshes updated since the last update.
num_vertices_tot: Total number of updated vertices in all sub-meshes.
num_triangles_tot: Total number of updated triangles in all sub-meshes.
max_sub_mesh: Maximum number of sub-meshes.
Returns
SL_ERROR_CODE_SUCCESS if the mesh is updated.

◆ sl_retrieve_mesh()

INTERFACE_API int sl_retrieve_mesh ( int  camera_id,
float *  vertices,
int *  triangles,
unsigned char *  colors,
float *  uvs,
unsigned char *  texture_ptr,
const int  max_submeshes 
)

Retrieves all chunks of the current mesh.

Note
Call sl_update_mesh before calling this.

Vertex and triangles arrays must be at least of the sizes returned by sl_update_mesh (nb_vertices and nb_triangles).

Parameters
camera_id: Id of the camera instance.
vertices: Vertices of the mesh
triangles: Triangles of the mesh.
colors: BGR colors of each vertex.
max_submeshes: Maximum number of sub-mesh that can be handled.
uvs: UVs of the texture.
texture_ptr: Texture of the mesh (if enabled).
Returns
SL_ERROR_CODE_SUCCESS if the mesh is retrieved.

◆ sl_update_chunks()

INTERFACE_API int sl_update_chunks ( int  camera_id,
int *  nb_vertices_per_submesh,
int *  nb_triangles_per_submesh,
int *  nb_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
const int  max_submesh 
)

Updates the Internal version of the mesh and returns the sizes of the meshes.

Parameters
camera_id: Id of the camera instance.
nb_vertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_submeshes: Number of sub-meshes.
updates_indices: List of all sub-meshes updated since the last update.
num_vertices_tot: Total number of updated vertices in all sub-meshes.
num_triangles_tot: Total number of updated triangles in all sub-meshes.
max_sub_mesh: Maximum number of sub-meshes.
Returns
SL_ERROR_CODE_SUCCESS if the chunks are updated.

◆ sl_retrieve_chunks()

INTERFACE_API int sl_retrieve_chunks ( int  camera_id,
float *  vertices,
int *  triangles,
unsigned char *  colors,
float *  uvs,
unsigned char *  texture_ptr,
const int  max_submesh 
)

Retrieves all chunks of the full mesh.

Note
Call sl_update_mesh before calling this.

Vertex and triangles arrays must be at least of the sizes returned by sl_update_mesh (nbVertices and nbTriangles).

Parameters
camera_id: Id of the camera instance.
max_submesh: Maximum number of sub-mesh that can be handled.
vertices: Vertices of the chunk.
triangles: Triangles of the chunk.
colors: BGR colors of the chunk.
uvs: UVs of the texture.
texture_ptr: Texture of the mesh (if enabled).
Returns
SL_ERROR_CODE_SUCCESS if the chunk is retrieved.

◆ sl_update_fused_point_cloud()

INTERFACE_API int sl_update_fused_point_cloud ( int  camera_id,
int *  nb_vertices_tot 
)

Updates the fused point cloud (if spatial map type was SL_SPATIAL_MAP_TYPE_FUSED_POINT_CLOUD).

Parameters
camera_id: Id of the camera instance.
num_vertices_tot: The total number of vertices.
Returns
SL_ERROR_CODE_SUCCESS if the fused point cloud is updated.

◆ sl_retrieve_fused_point_cloud()

INTERFACE_API int sl_retrieve_fused_point_cloud ( int  camera_id,
float *  vertices 
)

Retrieves all points of the fused point cloud.

Note
Call sl_update_fused_point_cloud before calling this.
Parameters
camera_id: Id of the camera instance.
vertices: Points of the fused point cloud.
Returns
SL_ERROR_CODE_SUCCESS if the fused point cloud is retrieved.

◆ sl_extract_whole_spatial_map()

INTERFACE_API int sl_extract_whole_spatial_map ( int  camera_id)

Extracts the current spatial map from the spatial mapping process.

Parameters
camera_id: Id of the camera instance.
Returns
SL_ERROR_CODE_SUCCESS if the mesh is filled and available, otherwise SL_ERROR_CODE_FAILURE.

◆ sl_save_mesh()

INTERFACE_API bool sl_save_mesh ( int  camera_id,
const char *  filename,
enum SL_MESH_FILE_FORMAT  format 
)

Saves the scanned mesh in a specific file format.

Parameters
camera_id: Id of the camera instance.
filename: Path and filename of the mesh.
format: File format (extension). Can be .obj, .ply or .bin.
Returns
Has the mesh been save successfully.

◆ sl_save_point_cloud()

INTERFACE_API bool sl_save_point_cloud ( int  c_id,
const char *  filename,
enum SL_MESH_FILE_FORMAT  format 
)

Saves the scanned point cloud in a specific file format.

Parameters
camera_id: Id of the camera instance.
filename: Path and filename of the point cloud.
format: File format (extension). Can be .obj, .ply or .bin.
Returns
Has the point cloud been save successfully.

◆ sl_load_mesh()

INTERFACE_API bool sl_load_mesh ( int  camera_id,
const char *  filename,
int *  nb_vertices_per_submesh,
int *  nb_triangles_per_submesh,
int *  num_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
int *  textures_size,
const int  max_submesh 
)

Loads a saved mesh file.

Parameters
camera_id: Id of the camera instance.
filename: Path and filename of the mesh. Should include the extension (.obj, .ply or .bin).
nb_ertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_sub_meshes: Number of sub-meshes.
updated_indices: List of all sub-meshes updated since the last update.
nb_vertices_tot: Total number of updated vertices in all sub-meshes.
nb_triangles_tot: Array of the number of triangles in each sub-mesh.
max_submesh: Maximum number of sub-meshes that can be handled.
texture_size: Array containing the sizes of all the textures (width, height) if applicable.
Returns
Has the mesh been loaded successfully.

◆ sl_apply_texture()

INTERFACE_API bool sl_apply_texture ( int  camera_id,
int *  nb_vertices_per_submesh,
int *  nb_triangles_per_submesh,
int *  nb_updated_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
int *  textures_size,
const int  max_submesh 
)

Applies the scanned texture onto the internal scanned mesh.

Parameters
camera_id: Id of the camera instance.
nb_vertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_sub_meshes: Number of sub-meshes.
updated_indices: List of all sub-meshes updated since the last update.
nb_vertices_tot: Total number of updated vertices in all sub-meshes.
nb_triangles_tot: Array of the number of triangles in each sub-mesh.
max_submesh: Maximum number of sub-meshes that can be handled.
texture_size: Array containing the sizes of all the textures (width, height) if applicable.
Returns
Has the texture been applied successfully.

◆ sl_filter_mesh()

INTERFACE_API bool sl_filter_mesh ( int  camera_id,
enum SL_MESH_FILTER  filter_params,
int *  nb_vertices_per_submesh,
int *  nb_triangles_per_submesh,
int *  nb_updated_submeshes,
int *  updated_indices,
int *  nb_vertices_tot,
int *  nb_triangles_tot,
const int  max_submesh 
)

Filters a mesh to removes triangles while still preserving its overall shaper (though less accurate).

Parameters
camera_id: Id of the camera instance.
filter_params: Filter level. Higher settings remove more triangles (SL_MESH_FILTER).
nb_vertices: Array of the number of vertices in each sub-mesh.
nb_triangles: Array of the number of triangles in each sub-mesh.
nb_sub_meshes: Number of sub-meshes.
updated_indices: List of all sub-meshes updated since the last update.
nb_vertices_tot: Total number of updated vertices in all sub-meshes.
nb_triangles_tot: Array of the number of triangles in each sub-mesh.
max_submesh: Maximum number of sub-meshes that can be handled.
Returns
Has the mesh been filtered successfully.

◆ sl_spatial_mapping_get_gravity_estimation()

INTERFACE_API void sl_spatial_mapping_get_gravity_estimation ( int  camera_id,
struct SL_Vector3 gravity 
)

Gets a vector pointing toward the direction of gravity. This is estimated from a 3D scan of the environment, and such, a scan must be started and finished for this value to be calculated.
If using a model other than SL_MODEL_ZED, this isn't required thanks to its IMU.

Parameters
camera_id: Id of the camera instance.
gravity: [Out] The vector of gravity.

◆ sl_update_whole_mesh()

INTERFACE_API int sl_update_whole_mesh ( int  camera_id,
int *  nb_vertices,
int *  nb_triangles 
)

Updates the internal version of the whole mesh and returns the size of its data.

Parameters
camera_id: id of the camera instance.
nb_vertices: Total number of updated vertices in all sub-meshes.
nb_triangles: Total number of updated triangles in all sub-meshes.
Returns
SUCCESS if the chunks are updated.

◆ sl_retrieve_whole_mesh()

INTERFACE_API int sl_retrieve_whole_mesh ( int  camera_id,
float *  vertices,
int *  triangles,
unsigned char *  colors,
float *  uvs,
unsigned char *  texture_ptr 
)

Retrieves the full mesh. Call update_mesh before calling this. Vertex and triangles arrays must be at least of the sizes returned by update_mesh (nb_vertices and nbTriangles).

Parameters
camera_id: id of the camera instance.
vertices: Vertices of the mesh
triangles: Triangles of the mesh.
colors: (b,g,r) colors of the mesh.
uvs: uvs of the texture.
texture_ptr: Texture of the mesh (if enabled).
Returns
SUCCESS if the chunk is retrieved.

◆ sl_load_whole_mesh()

INTERFACE_API bool sl_load_whole_mesh ( int  camera_id,
const char *  filename,
int *  nb_vertices,
int *  nb_triangles,
int *  texture_size 
)

Loads a saved mesh file.

Parameters
camera_id: id of the camera instance.
filename: Path and filename of the mesh. Should include the extension (.obj, .ply or .bin).
nb_vertices: Total number of updated vertices in all sub-meshes.
nb_triangles: Array of the number of triangles in each sub-mesh.
max_submesh: Maximum number of sub-meshes that can be handled.
texture_size: Array containing the sizes of all the textures (width ,height) if applicable.
Returns
Has the mesh been loaded successfully.

◆ sl_apply_whole_texture()

INTERFACE_API bool sl_apply_whole_texture ( int  camera_id,
int *  nb_vertices,
int *  nb_triangles,
int *  texture_size 
)

Applies the scanned texture onto the internal scanned mesh.

Parameters
camera_id: id of the camera instance.
nb_vertices: Total number of updated vertices in all sub-meshes.
nb_triangles: Array of the number of triangles in each sub-mesh.
texture_size: Array containing the sizes of all the textures (width ,height) if applicable.
Returns
Has the texture been applied successfully.

◆ sl_filter_whole_mesh()

INTERFACE_API bool sl_filter_whole_mesh ( int  camera_id,
enum SL_MESH_FILTER  filter_params,
int *  nb_vertices,
int *  nb_triangles 
)

Filters a mesh to removes triangles while still preserving its overall shaper (though less accurate).

Parameters
camera_id: id of the camera instance.
nb_vertices: Total number of updated vertices in all sub-meshes.
nb_triangles: Array of the number of triangles in each sub-mesh.
Returns
Has the mesh been filtered successfully.

◆ sl_find_floor_plane()

INTERFACE_API struct SL_PlaneData* sl_find_floor_plane ( int  camera_id,
struct SL_Quaternion reset_quaternion,
struct SL_Vector3 reset_translation,
struct SL_Quaternion  prior_rotation,
struct SL_Vector3  prior_translation 
)

Detect the floor plane of the scene.

Parameters
camera_id: Id of the camera instance.
reset_quaternion: The rotation to align the axis with the gravity.
reset_translation: The translation to align the tracking with the floor plane. The initial position will then be at ground height.
prior_rotation: Prior rotation.
prior_translation: Prior translation.
Returns
The detected floor plane if the function succeeded.

◆ sl_find_plane_at_hit()

INTERFACE_API struct SL_PlaneData* sl_find_plane_at_hit ( int  camera_id,
struct SL_Vector2  pixel,
struct SL_PlaneDetectionParameters params,
bool  thres 
)

Checks the plane at the given left image coordinates.

Parameters
camera_id: Id of the camera instance.
pixel: The image coordinate. The coordinate must be taken from the full-size image.
params: A structure containing all the specific parameters for the plane detection. Default: a preset of SL_PlaneDetectionParameters.
thres: Check if area is enough for Unity. If true, removes smaller planes.
Returns
Data of the detected plane.

◆ sl_convert_floorplane_to_mesh()

INTERFACE_API int sl_convert_floorplane_to_mesh ( int  camera_id,
float *  vertices,
int *  triangles,
int *  nb_vertices_tot,
int *  nb_triangles_tot 
)

Using data from a detected floor plane, updates supplied vertex and triangles arrays with data needed to make a mesh that represents it.

Parameters
camera_id: id of the camera instance.
vertices: Array to be filled with mesh vertices.
triangles: Array to be filled with mesh triangles, stored as indexes of each triangle's points.
nb_vertices_tot: Total number of vertices in the mesh.
nb_triangles_tot: Total triangles indexes (3x number of triangles).
Returns
SUCCESS if the mesh conversion was successful.

◆ sl_convert_hitplane_to_mesh()

INTERFACE_API int sl_convert_hitplane_to_mesh ( int  camera_id,
float *  vertices,
int *  triangles,
int *  nb_vertices_tot,
int *  nb_triangles_tot 
)

Using data from a detected hit plane, updates supplied vertex and triangles arrays with data needed to make a mesh that represents it.

Parameters
camera_id: id of the camera instance.
vertices: Array to be filled with mesh vertices.
triangles: Array to be filled with mesh triangles, stored as indexes of each triangle's points.
nb_vertices_tot: Total number of vertices in the mesh.
nb_triangles_tot: Total triangles indexes (3x number of triangles).
Returns
SUCCESS if the mesh conversion was successful.

◆ sl_retrieve_measure()

INTERFACE_API int sl_retrieve_measure ( int  camera_id,
void *  measure_ptr,
enum SL_MEASURE  type,
enum SL_MEM  mem,
int  width,
int  height 
)

Retrieves a measure texture from the ZED SDK.

Use this to get an individual texture from the last grabbed frame with measurements in every pixel - such as depth map, confidence map etc.
Measure textures are not human-viewable but don't lose accuracy, unlike image textures.

Parameters
camera_id: Id of the camera instance.
measure_ptr: Pointer to the measure texture.
type: Measure type (depth, confidence, xyz, etc). See SL_MEASURE.
mem: Whether the measure should be on CPU or GPU memory. See SL_MEM.
width: Width of the texture in pixel.
height: Height of the texture in pixel.
Returns
SL_ERROR_CODE_SUCCESS if the retrieve succeeded.
SL_ERROR_CODE_INVALID_FUNCTION_PARAMETERS if the view mode requires a module not enabled (VIEW::DEPTH with DEPTH_MODE::NONE for example).
SL_ERROR_CODE_INVALID_RESOLUTION if the resolution is higher than one provided by getCameraInformation().camera_configuration.resolution.
SL_ERROR_CODE_FAILURE if another error occurred.

◆ sl_retrieve_image()

INTERFACE_API int sl_retrieve_image ( int  camera_id,
void *  image_ptr,
enum SL_VIEW  type,
enum SL_MEM  mem,
int  width,
int  height 
)

Retrieves an image texture from the ZED SDK in a human-viewable format.

Image textures work for when you want the result to be visible, such as the direct RGB image from the camera, or a greyscale image of the depth. However it will lose accuracy if used to show measurements like depth or confidence, unlike measure textures.

Parameters
camera_id: Id of the camera instance.
image_ptr: Pointer to the image texture.
type: Image type (left RGB, right depth map, etc). See SL_VIEW.
mem: Whether the image should be on CPU or GPU memory (SL_MEM).
width: Width of the texture in pixel.
height: Height of the texture in pixel.
Returns
SL_ERROR_CODE_SUCCESS if the retrieve succeeded.

◆ sl_convert_image()

INTERFACE_API int sl_convert_image ( void *  image_in_ptr,
void *  image_signed_ptr,
cudaStream_t  stream 
)

Convert Image format from Unsigned char to Signed char, designed for Unreal Engine pipeline, works on GPU memory.

Parameters
image_in: input image to convert
image_signed: output image to converted
stream: a cuda stream to put the compute to (def. 0)
Note
If the Output Mat does not satisfies the requirements, it is freed and re-allocated.

◆ sl_enable_streaming()

INTERFACE_API int sl_enable_streaming ( int  camera_id,
enum SL_STREAMING_CODEC  codec,
unsigned int  bitrate,
unsigned short  port,
int  gop_size,
int  adaptative_bitrate,
int  chunk_size,
int  target_framerate 
)

Creates a streaming pipeline.

Parameters
camera_id: Id of the camera instance.
codec: defines the codec used for streaming (see SL_STREAMING_CODEC).
bitrate: defines the streaming bitrate in Kbits/s.
port: Defines the port used for streaming.
gop_size: Defines the gop size in number of frames.
adaptative_bitrate: Enable/disable adaptive bitrate.
chunk_size: Defines a single chunk size.
target_framrate: Defines the target framerate for the streaming output.
Returns
An SL_ERROR_CODE that defines if the stream was started.
Note
Available range for bitrate: [1000 - 60000]
STREAMING_CODEC Resolution FPS bitrate (kbps)
H264 HD2K 15 8500
H264 HD1080 30 12500
H264 HD720 60 7000
H265 HD2K 15 7000
H265 HD1080 30 11000
H265 HD720 60 6000

◆ sl_disable_streaming()

INTERFACE_API void sl_disable_streaming ( int  camera_id)

Disables the streaming initiated by sl_enable_streaming().

Parameters
camera_id: Id of the camera instance.

◆ sl_is_streaming_enabled()

INTERFACE_API int sl_is_streaming_enabled ( int  camera_id)

Tells if the streaming is running.

Parameters
camera_id: Id of the camera instance.
Returns
Is the streaming running successfully.

◆ sl_get_streaming_parameters()

INTERFACE_API struct SL_StreamingParameters* sl_get_streaming_parameters ( int  camera_id)

Returns the SL_StreamingParameters used.

It corresponds to the structure given as argument to the sl_enable_streaming() function.

Returns
SL_StreamingParameters containing the parameters used for streaming initialization.

◆ sl_save_current_image()

INTERFACE_API int sl_save_current_image ( int  camera_id,
enum SL_VIEW  view,
const char *  file_name 
)

Writes the image into a file defined by its extension.

Parameters
camera_id: id of the camera instance.
view: View of the image (SL_VIEW).
file_name: file path including the name and extension.
Returns
SUCCESS if the image was successfuly saved.

◆ sl_save_current_depth()

INTERFACE_API int sl_save_current_depth ( int  camera_id,
enum SL_SIDE  side,
const char *  file_name 
)

Writes the depth map into a file defined by its extension.

Parameters
camera_id: id of the camera instance.
side: side of the image (0 = left, 1 = right).
file_name: file path including the name and extension.
Returns
SUCCESS if the depth was successfuly saved.

◆ sl_save_current_point_cloud()

INTERFACE_API int sl_save_current_point_cloud ( int  camera_id,
enum SL_SIDE  side,
const char *  file_name 
)

Writes the point cloud into a file defined by its extension.

Parameters
camera_id: id of the camera instance.
side: side of the pc (0 = left, 1 = right).
file_name: file path including the name and extension.
Returns
SUCCESS if the point cloud was successfuly saved.

◆ sl_check_AI_model_status()

INTERFACE_API struct SL_AI_Model_status* sl_check_AI_model_status ( enum SL_AI_MODELS  model,
int  gpu_id 
)

Check if a corresponding optimized engine is found for the requested Model based on your rig configuration.

Parameters
model: AI model to check.
gpu_id: ID of the gpu.
Returns
The status of the given model for the specified GPU.

◆ sl_optimize_AI_model()

INTERFACE_API int sl_optimize_AI_model ( enum SL_AI_MODELS  model,
int  gpu_id 
)

Optimize the requested model, possible download if the model is not present on the host.

Parameters
model: AI model to optimize.
gpu_id: ID of the gpu to optimize on.
Returns
SUCCESS if the model is well optimized.

◆ sl_enable_object_detection()

INTERFACE_API int sl_enable_object_detection ( int  camera_id,
struct SL_ObjectDetectionParameters object_detection_parameters 
)

Initializes and starts object detection module.

The object detection module currently supports multiple class of objects with the SL_OBJECT_DETECTION_MODEL_MULTI_CLASS_BOX or SL_OBJECT_DETECTION_MODEL_MULTI_CLASS_BOX_ACCURATE.
The full list of detectable objects is available through SL_OBJECT_CLASS and SL_OBJECT_SUBCLASS.

Note
- This Deep Learning detection module is not available for MODEL::ZED cameras (ZED first generation)..
- This feature uses AI to locate objects and requires a powerful GPU. A GPU with at least 3GB of memory is recommended.

Detected objects can be retrieved using the sl_retrieve_objects() function.

Parameters
camera_id: Id of the camera instance.
object_detection_parameters: A structure containing all the specific parameters for the object detection. Default: a preset of SL_ObjectDetectionParameters.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine.
SL_ERROR_CODE_CORRUPTED_SDK_INSTALLATION if the AI model is missing or corrupted. In this case, the SDK needs to be reinstalled.
SL_ERROR_CODE_MODULE_NOT_COMPATIBLE_WITH_CAMERA if the camera used does not have a IMU (SL_MODEL_ZED).
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct (not SL_MODEL_ZED) but the IMU is missing. It probably happens because SL_InitParameters::sensors_required was set to false and that IMU has not been found.
SL_ERROR_CODE_INVALID_FUNCTION_CALL if one of the object_detection_parameters parameter is not compatible with other modules parameters (for example, depth_mode has been set to SL_DEPTH_MODE_NONE).
SL_ERROR_CODE_FAILURE otherwise.
Note
The IMU gives the gravity vector that helps in the 3D box localization.

◆ sl_get_object_detection_parameters()

INTERFACE_API struct SL_ObjectDetectionParameters* sl_get_object_detection_parameters ( int  camera_id)

Returns the SL_ObjectDetectionParameters used.

It corresponds to the structure given as argument to the sl_enable_object_detection() function.

Parameters
camera_id: Id of the camera instance.
Returns
SL_ObjectDetectionParameters containing the parameters used for object detection initialization.

◆ sl_disable_object_detection()

INTERFACE_API void sl_disable_object_detection ( int  camera_id,
unsigned int  instance_id,
bool  force_disable_all_instances 
)

Disables the Object Detection process.

The object detection module immediately stops and frees its memory allocations.

Parameters
camera_id: Id of the camera instance.
instance_id: Id of the object detection instance. Used when multiple instances of the object detection module are enabled at the same time.
force_disable_all_instances: Should disable all instances of the object detection module or just instance_id.

◆ sl_enable_body_tracking()

INTERFACE_API int sl_enable_body_tracking ( int  camera_id,
struct SL_BodyTrackingParameters body_tracking_parameters 
)

Initializes and starts the Deep Learning Body Tracking module.

The body tracking module currently supports multiple classes of human skeleton detection with the SL_BODY_TRACKING_MODEL_HUMAN_BODY_FAST, SL_BODY_TRACKING_MODEL_HUMAN_BODY_MEDIUM or SL_BODY_TRACKING_MODEL_HUMAN_BODY_ACCURATE.
This model only detects humans but provides a full skeleton map for each person.

Note
- This Deep Learning detection module is not available for MODEL::ZED cameras (ZED first generation)..
- This feature uses AI to locate objects and requires a powerful GPU. A GPU with at least 3GB of memory is recommended.

Detected objects can be retrieved using the sl_retrieve_bodies() function.

Parameters
camera_id: Id of the camera instance.
body_tracking_parameters: A structure containing all the specific parameters for the body tracking. Default: a preset of SL_BodyTrackingParameters.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine.
SL_ERROR_CODE_CORRUPTED_SDK_INSTALLATION if the AI model is missing or corrupted. In this case, the SDK needs to be reinstalled.
SL_ERROR_CODE_MODULE_NOT_COMPATIBLE_WITH_CAMERA if the camera used does not have a IMU (SL_MODEL_ZED).
SL_ERROR_CODE_MOTION_SENSORS_REQUIRED if the camera model is correct (not SL_MODEL_ZED) but the IMU is missing. It probably happens because SL_InitParameters::sensors_required was set to false and that IMU has not been found.
SL_ERROR_CODE_INVALID_FUNCTION_CALL if one of the object_detection_parameters parameter is not compatible with other modules parameters (for example, depth_mode has been set to SL_DEPTH_MODE_NONE).
SL_ERROR_CODE_FAILURE otherwise.
Note
The IMU gives the gravity vector that helps in the 3D box localization.

◆ sl_get_body_tracking_parameters()

INTERFACE_API struct SL_BodyTrackingParameters* sl_get_body_tracking_parameters ( int  camera_id)

Returns the SL_BodyTrackingParameters used.

It corresponds to the structure given as argument to the sl_enable_body_tracking() function.

Parameters
camera_id: Id of the camera instance.
Returns
SL_BodyTrackingParameters containing the parameters used for body tracking initialization.

◆ sl_disable_body_tracking()

INTERFACE_API void sl_disable_body_tracking ( int  camera_id,
unsigned int  instance_id,
bool  force_disable_all_instances 
)

Disables the body tracking process.

The body tracking module immediately stops and frees its memory allocations.

Parameters
camera_id: Id of the camera instance.
instance_id: Id of the body tracking instance. Used when multiple instances of the body tracking module are enabled at the same time.
force_disable_all_instances: Should disable all instances of the tracking module module or just instance_id.

◆ sl_generate_unique_id()

INTERFACE_API int sl_generate_unique_id ( char *  uuid)

Generate a UUID like unique id to help identify and track AI detections.

Parameters
uuid: Unique ID generated.
Returns
Size of the unique ID generated.

◆ sl_ingest_custom_box_objects()

INTERFACE_API int sl_ingest_custom_box_objects ( int  camera_id,
int  nb_objects,
struct SL_CustomBoxObjectData objects_in 
)

Feed the 3D Object tracking function with your own 2D bounding boxes from your own detection algorithm.

Parameters
camera_id: Id of the camera instance.
objects_in: 2D detections from custom detection algorithm.
nb_objects: Number of custom objects (size of the object_in array).
Note
The detection should be done on the current grabbed left image as the internal process will use all current available data to extract 3D informations and perform object tracking.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_retrieve_objects()

INTERFACE_API int sl_retrieve_objects ( int  camera_id,
struct SL_ObjectDetectionRuntimeParameters object_detection_runtime_parameters,
struct SL_Objects objects,
unsigned int  instance_id 
)

Retrieve objects detected by the object detection module.

Parameters
camera_id: Id of the camera instance.
objects: 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_runtime_parameters: Object detection runtime settings, can be changed at each detection. In async mode, the parameters update is applied on the next iteration.
instance_id: Id of the object detection instance. Used when multiple instances of the object detection module are enabled at the same time.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_retrieve_bodies()

INTERFACE_API int sl_retrieve_bodies ( int  camera_id,
struct SL_BodyTrackingRuntimeParameters body_tracking_runtime_parameters,
struct SL_Bodies bodies,
unsigned int  instance_id 
)

Retrieve bodies detected by the body tracking module.

Parameters
camera_id: id of the camera instance.
bodies: The detected bodies 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.
body_tracking_runtime_parameters: Body Tracking runtime settings, can be changed at each detection. In async mode, the parameters update is applied on the next iteration.
instance_id: Id of the object detection instance. Used when multiple instances of the object detection module are enabled at the same time.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_update_objects_batch()

INTERFACE_API int sl_update_objects_batch ( int  camera_id,
int *  nb_batches 
)

Updates the internal batch of detected objects.

Parameters
camera_id: Id of the camera instance.
nb_batches: [Out] Number of batches.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_get_objects_batch()

INTERFACE_API int sl_get_objects_batch ( int  camera_id,
int  index,
struct SL_ObjectsBatch objs_batch 
)

Gets a batch of detected objects.

Note
Need to be called after sl_update_objects_batch().
Parameters
camera_id: Id of the camera instance.
objs_batch: Structure containing all the specific data of the object batch module
index: Desired index in the trajectories vector.
Returns
SL_ERROR_CODE_SUCCESS if everything went fine, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_fusion_init()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_init ( struct SL_InitFusionParameters params)

FusionHandler initialisation. Initializes memory/generic datas.

Parameters
[in]params: structure containing all init parameters for the fusion API
Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_process()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_process ( )

process the fusion.

Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_retrieve_image()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_image ( void *  mat,
struct SL_CameraIdentifier uuid,
int  width,
int  height 
)

Returns the current sl_VIEW_LEFT of the specified camera, the data is synchronized.

Parameters
matthe CPU BGRA image of the requested camera.
uuidthe requested camera identifier.
widththe requested width of the output image, can be lower or equal (default) to the original image width.
heightthe requested height of the output image, can be lower or equal (default) to the original image height.
Returns
SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.
Note
Only the Left BGRA image is available.

◆ sl_fusion_retrieve_measure()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_measure ( void *  mat,
struct SL_CameraIdentifier uuid,
enum SL_MEASURE  measure,
int  width,
int  height 
)

Returns the current measure of the specified camera, the data is synchronized.

Parameters
matthe CPU data of the requested camera.
uuidthe requested camera identifier.
measurethe requested measure type, by default DEPTH (F32_C1)
widththe requested width of the output image, can be lower or equal (default) to the original image width.
heightthe requested height of the output image, can be lower or equal (default) to the original image height.
Returns
SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.
Note
Only MEASURE: DEPTH, XYZ, XYZRGBA, XYZBGRA, XYZARGB, XYZABGR, DEPTH_U16_MM are available.

◆ sl_fusion_unsubscribe()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_unsubscribe ( struct SL_CameraIdentifier uuid)

Remove the specified camera from data provider.

Parameters
uuidThe requested camera identifier.
Returns
SUCCESS if it goes as it should, otherwise it returns an SL_FUSION_ERROR_CODE.

◆ sl_fusion_read_configuration_file()

INTERFACE_API void sl_fusion_read_configuration_file ( char  json_config_filename[256],
enum SL_COORDINATE_SYSTEM  coord_system,
enum SL_UNIT  unit,
struct SL_FusionConfiguration configs,
int *  nb_cameras 
)

Read a Configuration JSON file to configure a fusion process.

Parameters
json_config_filename: The name of the JSON file containing the configuration
coord_sys: The COORDINATE_SYSTEM in which you want the World Pose to be in.
unit: The UNIT in which you want the World Pose to be in.
Returns
a vector of SL_FusionConfiguration for all the camera present in the file.
Note
empty if no data were found for the requested camera.

◆ sl_fusion_enable_body_tracking()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_body_tracking ( struct SL_BodyTrackingFusionParameters params)

enables Object detection fusion module

Parameters
[in]parametersdefined by sl::ObjectDetectionFusionParameters
Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_retrieve_bodies()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_bodies ( struct SL_Bodies bodies,
struct SL_BodyTrackingFusionRuntimeParameters rt,
struct SL_CameraIdentifier  uuid 
)

retrieves a list of bodies (in SL_Bodies class type) seen by all cameras and merged as if it was seen by a single super-camera.

Note
Internal calls retrieveObjects() for all listed cameras, then merged into a single SL_Bodies
Parameters
[out]bodieslist of objects seen by all available cameras
Note
Only the 3d informations is available in the returned object.
Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_get_process_metrics()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_get_process_metrics ( struct SL_FusionMetrics metrics)

get the stats of a given camera in the Fusion API side It can be the received FPS, drop frame, latency, etc

Parameters
metrics: structure containing all the metrics available
Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_enable_positional_tracking()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_positional_tracking ( struct SL_PositionalTrackingFusionParameters params)

enable positional tracking fusion.

Note
note that for the alpha version of the API, the positional tracking fusion doesn't support the area memory feature
Returns
SL_FUSION_ERROR_CODE

◆ sl_fusion_get_position()

INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_position ( struct SL_PoseData pose,
enum SL_REFERENCE_FRAME  reference_frame,
enum SL_UNIT  unit,
struct SL_CameraIdentifier uuid,
enum SL_POSITION_TYPE  retrieve_type 
)

Get the Fused Position of the camera system.

Parameters
camera_posewill contain the camera pose in world position (world position is given by the calibration of the cameras system)
reference_framedefines the reference from which you want the pose to be expressed. Default : REFERENCE_FRAME::WORLD.
uuidCamera identifier
Returns
POSITIONAL_TRACKING_STATE is the current state of the tracking process

◆ sl_fusion_get_fused_positional_tracking_status()

INTERFACE_API struct SL_FusedPositionalTrackingStatus* sl_fusion_get_fused_positional_tracking_status ( )

Get the current status of fused position.

Returns
SL_FusedPositionalTrackingStatus is the current status of the tracking process.

◆ sl_fusion_ingest_gnss_data()

INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_ingest_gnss_data ( struct SL_GNSSData gnss_data,
bool  radian 
)

Add GNSS that will be used by fusion for computing fused pose.

Parameters
out[in]: the current GNSS data
radian[in] : true if the gnssdata is set in radian

◆ sl_fusion_get_current_gnss_data()

INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_current_gnss_data ( struct SL_GNSSData data,
bool  radian 
)

returns the current GNSS data

Parameters
out[out]: the current GNSS data
radian[in] : true if the gnss data is set in radian
Returns
POSITIONAL_TRACKING_STATE is the current state of the tracking process

◆ sl_fusion_get_geo_pose()

INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_geo_pose ( struct SL_GeoPose pose,
bool  radian 
)

returns the current GeoPose

Parameters
pose[out]: the current GeoPose
radian[in] : true if the geopose is set in radian.
Returns
SL_GNSS_FUSION_STATUS is the current state of the tracking process

◆ sl_fusion_geo_to_camera()

INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_geo_to_camera ( struct SL_LatLng in,
struct SL_PoseData out,
bool  radian 
)

Convert latitude / longitude into position in sl::Fusion coordinate system.

Parameters
inthe current GeoPose
out[out]: the current Pose
radian[in] : true if the geopose is set in radian.
Returns
SL_GNSS_FUSION_STATUS is the current state of the tracking process

◆ sl_fusion_camera_to_geo()

INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_camera_to_geo ( struct SL_PoseData in,
struct SL_GeoPose out,
bool  radian 
)

returns the current GeoPose

Parameters
pose[out]: the current GeoPose
radian[in] : true if the geopose is set in radian.
Returns
SL_GNSS_FUSION_STATUS is the current state of the tracking process

◆ sl_fusion_get_current_timestamp()

INTERFACE_API unsigned long long sl_fusion_get_current_timestamp ( )

returns the current timestamp

Returns
the current timestamp in nanoseconds.

◆ sl_fusion_get_current_gnss_calibration_std()

INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_current_gnss_calibration_std ( float *  yaw_std,
struct SL_Vector3 position_std 
)

Get the current calibration uncertainty defined during calibration process.

Parameters
yaw_std[out] yaw uncertainty
x_std[out] position uncertainty
Returns
SL_GNSS_FUSION_STATUS representing current initialisation status

◆ sl_fusion_get_geo_tracking_calibration()

INTERFACE_API void sl_fusion_get_geo_tracking_calibration ( struct SL_Vector3 translation,
struct SL_Quaternion rotation 
)

Get the calibration found between VIO and GNSS.

Returns
sl::Transform transform containing calibration found between VIO and GNSS

◆ sl_mat_create_new()

INTERFACE_API void* sl_mat_create_new ( int  width,
int  height,
enum SL_MAT_TYPE  type,
enum SL_MEM  mem 
)

Creates a matrix with the given resolution.

Parameters
width: Width of the new matrix.
height: Height of the new matrix.
type: Data type and number of channels the matrix will hold (see SL_MAT_TYPE).
mem: Whether the matrix should be stored on CPU or GPU memory (SL_MEM).
Returns
Pointer of the matrix.

◆ sl_mat_create_new_empty()

INTERFACE_API void* sl_mat_create_new_empty ( )

Creates an empty matrix.

Returns
Pointer of the empty matrix.

◆ sl_mat_is_init()

INTERFACE_API bool sl_mat_is_init ( void *  ptr)

Returns whether the matrix is initialized or not.

Parameters
ptr: Pointer of the matrix.
Returns
True if the matrix has been initialized.

◆ sl_mat_free()

INTERFACE_API void sl_mat_free ( void *  ptr,
enum SL_MEM  mem 
)

Frees the memory of the matrix.

Parameters
ptr: Pointer of the matrix to free.
mem: Specifies which memory you wish to free. Default: SL_MEM_CPU

◆ sl_mat_get_infos()

INTERFACE_API void sl_mat_get_infos ( void *  ptr,
char *  buffer 
)

Returns the information about the matrix into a string.

Parameters
ptr: Pointer of the matrix to get information from.
buffer: Buffer providing matrix information.

◆ sl_mat_get_value_uchar()

INTERFACE_API int sl_mat_get_value_uchar ( void *  ptr,
int  col,
int  row,
unsigned char *  value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C1.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_uchar2()

INTERFACE_API int sl_mat_get_value_uchar2 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar2 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C2.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_uchar3()

INTERFACE_API int sl_mat_get_value_uchar3 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar3 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C3.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_uchar4()

INTERFACE_API int sl_mat_get_value_uchar4 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar4 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C4.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_float()

INTERFACE_API int sl_mat_get_value_float ( void *  ptr,
int  col,
int  row,
float *  value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C1.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_float2()

INTERFACE_API int sl_mat_get_value_float2 ( void *  ptr,
int  col,
int  row,
struct SL_Vector2 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C2.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_float3()

INTERFACE_API int sl_mat_get_value_float3 ( void *  ptr,
int  col,
int  row,
struct SL_Vector3 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C3.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_get_value_float4()

INTERFACE_API int sl_mat_get_value_float4 ( void *  ptr,
int  col,
int  row,
struct SL_Vector4 value,
enum SL_MEM  mem 
)

Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C4.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to get the value from.
row: Row of the point to get the value from.
value[Out]: Variable to store the value to get.
mem: Which memory should be read.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_uchar()

INTERFACE_API int sl_mat_set_value_uchar ( void *  ptr,
int  col,
int  row,
unsigned char  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C1.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_uchar2()

INTERFACE_API int sl_mat_set_value_uchar2 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar2  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C2.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_uchar3()

INTERFACE_API int sl_mat_set_value_uchar3 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar3  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C3.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_uchar4()

INTERFACE_API int sl_mat_set_value_uchar4 ( void *  ptr,
int  col,
int  row,
struct SL_Uchar4  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C4.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_float()

INTERFACE_API int sl_mat_set_value_float ( void *  ptr,
int  col,
int  row,
float  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C1.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_float2()

INTERFACE_API int sl_mat_set_value_float2 ( void *  ptr,
int  col,
int  row,
struct SL_Vector2  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C2.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_float3()

INTERFACE_API int sl_mat_set_value_float3 ( void *  ptr,
int  col,
int  row,
struct SL_Vector3  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C3.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_value_float4()

INTERFACE_API int sl_mat_set_value_float4 ( void *  ptr,
int  col,
int  row,
struct SL_Vector4  value,
enum SL_MEM  mem 
)

Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C4.

Parameters
ptr: Pointer of the matrix.
col: Column of the point to set the value.
row: Row of the point to set the value.
value: Value to be set.
mem: Which memory will be updated.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_uchar()

INTERFACE_API int sl_mat_set_to_uchar ( void *  ptr,
unsigned char  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_U8_C1 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_uchar2()

INTERFACE_API int sl_mat_set_to_uchar2 ( void *  ptr,
struct SL_Uchar2  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_U8_C2 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_uchar3()

INTERFACE_API int sl_mat_set_to_uchar3 ( void *  ptr,
struct SL_Uchar3  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_U8_C3 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_uchar4()

INTERFACE_API int sl_mat_set_to_uchar4 ( void *  ptr,
struct SL_Uchar4  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_U8_C4 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_float()

INTERFACE_API int sl_mat_set_to_float ( void *  ptr,
float  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_F32_C1 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_float2()

INTERFACE_API int sl_mat_set_to_float2 ( void *  ptr,
struct SL_Vector2  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_F32_C2 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_float3()

INTERFACE_API int sl_mat_set_to_float3 ( void *  ptr,
struct SL_Vector3  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_F32_C3 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_set_to_float4()

INTERFACE_API int sl_mat_set_to_float4 ( void *  ptr,
struct SL_Vector4  value,
enum SL_MEM  mem 
)

Fills the matrix of type SL_MAT_TYPE_F32_C4 with the given value.

Parameters
ptr: Pointer of the matrix.
value: Value with which to fill the matrix.
mem: Which buffer to fill.
Returns
SL_ERROR_CODE (as an integer) indicating if the get was successful, or why it wasn't.

◆ sl_mat_update_cpu_from_gpu()

INTERFACE_API int sl_mat_update_cpu_from_gpu ( void *  ptr)

Copies data from the GPU to the CPU, if possible.

Parameters
ptr: Pointer of the matrix.
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_update_gpu_from_cpu()

INTERFACE_API int sl_mat_update_gpu_from_cpu ( void *  ptr)

Copies data from the CPU to the GPU, if possible.

Parameters
ptr: Pointer of the matrix.
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_copy_to()

INTERFACE_API int sl_mat_copy_to ( void *  ptr,
void *  ptr_dest,
enum SL_COPY_TYPE  cpy_type 
)

Copies data from this matrix to another matrix (deep copy).

Parameters
ptr: Pointer of the source matrix.
ptr_dest: Pointer of the destination matrix.
cpy_type: Specifies the memory that will be used for the copy (see SL_COPY_TYPE).
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_read()

INTERFACE_API int sl_mat_read ( void *  ptr,
const char *  file_path 
)

Reads an image from a file.

Supports .png and .jpeg. Only works if matrix has access to SL_MEM_CPU.

Parameters
ptr: Pointer of the matrix.
file_path: Path of the file to read from (including the name and extension).
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_write()

INTERFACE_API int sl_mat_write ( void *  ptr,
const char *  file_path 
)

Writes the Mat into a file as an image. Only works if Mat has access to MEM_CPU.

Parameters
ptr: Pointer of the matrix.
file_path: Path of the file to write (including the name and extension).
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_get_width()

INTERFACE_API int sl_mat_get_width ( void *  ptr)

Returns the width of the matrix.

Parameters
ptr: Pointer of the matrix.
Returns
Width of the matrix in pixels.

◆ sl_mat_get_height()

INTERFACE_API int sl_mat_get_height ( void *  ptr)

Returns the height of the matrix.

Parameters
ptr: Pointer of the matrix.
Returns
Height of the matrix in pixels.

◆ sl_mat_get_channels()

INTERFACE_API int sl_mat_get_channels ( void *  ptr)

Returns the number of values stored in one pixel.

Parameters
ptr: Pointer of the matrix.
Returns
Number of values in a pixel.

◆ sl_mat_get_memory_type()

INTERFACE_API int sl_mat_get_memory_type ( void *  ptr)

Gets the type of memory (CPU and/or GPU).

Parameters
ptr: Pointer of the matrix.
Returns
Type of allocated memory (SL_MEM).

◆ sl_mat_get_data_type()

INTERFACE_API int sl_mat_get_data_type ( void *  ptr)

Returns the format of the matrix.

Parameters
ptr: Pointer of the matrix.
Returns
The memory type (SL_MAT_TYPE).

◆ sl_mat_get_pixel_bytes()

INTERFACE_API int sl_mat_get_pixel_bytes ( void *  ptr)

Returns the size of one pixel in bytes.

Parameters
ptr: Pointer of the matrix.
Returns
Size of a pixel in bytes.

◆ sl_mat_get_step()

INTERFACE_API int sl_mat_get_step ( void *  ptr,
enum SL_MEM  mem 
)

Returns the memory step in number of elements (size in one pixel row).

Parameters
ptr: Pointer of the matrix.
mem: Specifies whether you want SL_MEM_CPU or SL_MEM_GPU step.
Returns
The step in number of elements.

◆ sl_mat_get_step_bytes()

INTERFACE_API int sl_mat_get_step_bytes ( void *  ptr,
enum SL_MEM  mem 
)

Returns the memory step in bytes (size of one pixel row).

Parameters
ptr: Pointer of the matrix.
mem: Specifies whether you want SL_MEM_CPU or SL_MEM_GPU step.
Returns
The step in bytes of the specified memory.

◆ sl_mat_get_width_bytes()

INTERFACE_API int sl_mat_get_width_bytes ( void *  ptr)

Returns the size of a row in bytes.

Parameters
ptr: Pointer of the matrix.
Returns
Size of a row in bytes.

◆ sl_mat_is_memory_owner()

INTERFACE_API bool sl_mat_is_memory_owner ( void *  ptr)

Returns whether the matrix is the owner of the memory it accesses.

Returns
true if the matrix is owning its memory, else false.

◆ sl_mat_get_resolution()

INTERFACE_API struct SL_Resolution sl_mat_get_resolution ( void *  ptr)

Returns the resolution (width and height) of the matrix.

Parameters
ptr: Pointer of the matrix.
Returns
SL_Resolution of the matrix in pixels.

◆ sl_mat_alloc()

INTERFACE_API void sl_mat_alloc ( void *  ptr,
int  width,
int  height,
enum SL_MAT_TYPE  type,
enum SL_MEM  mem 
)

Allocates memory for the matrix.

Parameters
ptr: Pointer of the matrix.
width: Width of the matrix in pixels.
height: Height of the matrix in pixels.
type: Type of the matrix (SL_MAT_TYPE_F32_C1, SL_MAT_TYPE_U8_C4, etc.).
mem: Where the buffer will be stored.

◆ sl_mat_set_from()

INTERFACE_API int sl_mat_set_from ( void *  ptr,
void *  ptr_source,
enum SL_COPY_TYPE  copy_type 
)

Copies data from another matrix into this one (deep copy).

Parameters
ptr: Pointer of the matrix.
ptr_source: Source matrix from which to copy.
copy_type: Specifies the memory that will be used for the copy (see SL_COPY_TYPE).
mem: Where the buffer will be stored.
Returns
SL_ERROR_CODE_SUCCESS if everything went well, SL_ERROR_CODE_FAILURE otherwise.

◆ sl_mat_get_ptr()

INTERFACE_API int* sl_mat_get_ptr ( void *  ptr,
enum SL_MEM  mem 
)

Gets a pointer to the matrix.

Parameters
ptr: Pointer of the matrix.
mem: Whether the matrix should exist on CPU or GPU memory (SL_MEM).
Returns
A pointer to the matrix.

◆ sl_mat_clone()

INTERFACE_API int sl_mat_clone ( void *  ptr,
void *  ptr_source 
)

Duplicates a matrix by copying all its data into a new one (deep copy).

Parameters
ptr: Pointer of the matrix.
ptr_source: Source matrix from which to copy.

◆ sl_mat_swap()

INTERFACE_API void sl_mat_swap ( void *  ptr_1,
void *  ptr_2 
)

Swaps the content of the provided matrix (only swaps the pointers, no data copy).

Parameters
ptr1: Pointer of the first matrix to swap.
ptr2: Pointer of the second matrix to swap.