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 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 camera depending on the init parameters. 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_InitParameters * | sl_get_init_parameters (int camera_id) |
Returns the initparameters used to open the ZED camera. More... | |
INTERFACE_API struct SL_RuntimeParameters * | sl_get_runtime_parameters (int camera_id) |
Returns the Runtimeparameters used to open the ZED camera. More... | |
INTERFACE_API struct SL_PositionalTrackingParameters * | sl_get_positional_tracking_parameters (int camera_id) |
Returns the PositionalTrackingParameters. More... | |
INTERFACE_API void | sl_close_camera (int camera_id) |
Destroys the camera and disable the textures. More... | |
INTERFACE_API int | sl_set_region_of_interest (int camera_id, void *roi_mask) |
Defines a region of interest to focus on for all the SDK, discarding other parts. More... | |
INTERFACE_API int | sl_grab (int camera_id, struct SL_RuntimeParameters *runtime) |
Grabs the lastest 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 an hardware reset of the ZED 2 / 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. 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. More... | |
INTERFACE_API struct SL_RecordingStatus * | sl_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 enableRecording() and closes the generated file. More... | |
INTERFACE_API struct SL_RecordingParameters * | sl_get_recording_parameters (int camera_id) |
Returns the recording parameters used. Correspond to the structure send when the sl_enable_recording() function was called. More... | |
INTERFACE_API void | sl_pause_recording (int camera_id, bool status) |
Pauses or resumes the recording. 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. This function allows you to enable the position estimation of the SDK. It only has to be called once in the camera's lifetime. More... | |
INTERFACE_API void | sl_disable_positional_tracking (int camera_id, 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. 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. This function allows you to move around within a played-back SVO file. After calling, the next call to grab() will read the provided frame number. 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_CameraInformation * | sl_get_camera_information (int camera_id, int res_width, int res_height) |
Returns the calibration parameters, serial number and other information about the camera being used. More... | |
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. More... | |
INTERFACE_API struct SL_CalibrationParameters * | sl_get_calibration_parameters (int camera_id, bool raw_params) |
Gets the Calibration Parameters. More... | |
INTERFACE_API struct SL_SensorsConfiguration * | sl_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 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 ZED mcu 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. (should be called after a grab). More... | |
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. More... | |
INTERFACE_API int | sl_get_svo_number_of_frames (int camera_id) |
Gets the total number of frames in the loaded SVO file. More... | |
INTERFACE_API void | sl_set_camera_settings (int camera_id, enum SL_VIDEO_SETTINGS mode, int value) |
Sets a value in the ZED's camera settings. More... | |
INTERFACE_API int | 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 int | sl_get_camera_settings (int camera_id, enum SL_VIDEO_SETTINGS mode) |
Gets the value of a given setting from the ZED camera. More... | |
INTERFACE_API int | 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 version of the currently installed ZED SDK. More... | |
INTERFACE_API unsigned int | sl_get_frame_dropped_count (int camera_id) |
Gets the number of frames dropped since 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) |
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_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 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 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) |
Sets a prior to the IMU orientation (using a ZED-mini, ZED2 or ZED2i). 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. 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 ZED-M/ZED2 IMU. Returns an error if using ZED (v1) which does not contains internal sensors. More... | |
INTERFACE_API int | sl_get_sensors_data (int camera_id, struct SL_SensorData *data, enum SL_TIME_REFERENCE time_reference) |
Gets the full Sensor data from the ZED-M/ZED2/ZED2i. Returns an error is using ZED (v1) which does not contains internal sensors. 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 begins 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_SpatialMappingParameters * | sl_get_spatial_mapping_parameters (int camera_id) |
Returns the spatial mapping parameters used. Correspond to the structure send when the enableSpatialMapping() function was called. 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 mesh generation process in a thread that doesn't block the spatial mapping process. More... | |
INTERFACE_API int | sl_get_mesh_request_status_async (int camera_id) |
Returns the mesh generation status. Useful for knowing when to update and retrieve the mesh. More... | |
INTERFACE_API enum SL_SPATIAL_MAPPING_STATE | sl_get_spatial_mapping_state (int camera_id) |
Gets the current state of spatial mapping. 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, float *uvs, unsigned char *texture_ptr, const int max_submeshes) |
Retrieves all chunks of the current 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 nb_triangles). 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, float *uvs, unsigned char *texture_ptr, const int max_submesh) |
Retrieves all chunks of the full mesh. Call update_mesh before calling this. Vertex and triangles arrays must be at least of the sizes returned by update_mesh (nbVertices and nbTriangles). 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 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. Call update_fused_point_cloud before calling this. 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 the ZED_M /ZED2, 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, 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_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) |
Looks for a plane in the visible area that is likely to represent the floor. More... | |
INTERFACE_API struct SL_PlaneData * | sl_find_plane_at_hit (int camera_id, struct SL_Vector2 pixel, bool thres) |
Check for a plane in hte real world at given screen-space 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. 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. 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. 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. 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 enable_streaming(). More... | |
INTERFACE_API int | sl_is_streaming_enabled (int camera_id) |
Tells if the streaming is running (true) or still initializing (false). More... | |
INTERFACE_API struct SL_StreamingParameters * | sl_get_streaming_parameters (int camera_id) |
Returns the streaming parameters used. Correspond to the structure send when the sl_enable_streaming() function was called. 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_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. 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_objects_detection (int camera_id, struct SL_ObjectDetectionParameters *object_detection_parameters) |
Initializes and starts the Deep Learning detection module. The object detection module currently supports two types of detection : More... | |
INTERFACE_API struct SL_ObjectDetectionParameters * | sl_get_object_detection_parameters (int cmaera_id) |
Returns the object detection parameters used. Correspond to the structure send when the enableObjectDetection() function was called. More... | |
INTERFACE_API void | sl_pause_objects_detection (int camera_id, bool status) |
Pauses or resumes the object detection processes. More... | |
INTERFACE_API void | sl_disable_objects_detection (int camera_id) |
Disables the Object Detection 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) |
Retrieve objects detected by the object detection 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. Need to be called after update_objects_batch(). 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 keypoints_2d[MAX_TRAJECTORY_SIZE][18], struct SL_Vector3 keypoints[MAX_TRAJECTORY_SIZE][18], 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], float keypoints_confidences[MAX_TRAJECTORY_SIZE][18]) |
INTERFACE_API void * | sl_mat_create_new (int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem) |
Creates a Mat with the given resolution. More... | |
INTERFACE_API void * | sl_mat_create_new_empty () |
Creates an empty Mat with the given resolution. More... | |
INTERFACE_API bool | sl_mat_is_init (void *ptr) |
Tells if the Mat has been initialized. More... | |
INTERFACE_API void | sl_mat_free (void *ptr, enum SL_MEM mem) |
Frees the memory of the Mat. More... | |
INTERFACE_API void | sl_mat_get_infos (void *ptr, char *buffer) |
Returns information about the Mat. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. More... | |
INTERFACE_API int | sl_mat_set_to_uchar (void *ptr, unsigned char value, enum SL_MEM mem) |
Fills the entire Mat 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 entire Mat 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 entire Mat 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 entire Mat with the given value. More... | |
INTERFACE_API int | sl_mat_set_to_float (void *ptr, float value, enum SL_MEM mem) |
Fills the entire Mat 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 entire Mat 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 entire Mat 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 entire Mat 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 Mat to another Mat (deep copy). More... | |
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 Mat has access to MEM_CPU. 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) |
Gets the Width of the matrix. More... | |
INTERFACE_API int | sl_mat_get_height (void *ptr) |
Gets the Height of the matrix. More... | |
INTERFACE_API int | sl_mat_get_channels (void *ptr) |
Gets the number of channels stored in each 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) |
Gets the type of data (Mat_Type). More... | |
INTERFACE_API int | sl_mat_get_pixel_bytes (void *ptr) |
Gets the size in bytes of one pixel. More... | |
INTERFACE_API int | sl_mat_get_step (void *ptr, enum SL_MEM mem) |
Gets the memory 'step' in number/length of elements - how many values make up each row of pixels. More... | |
INTERFACE_API int | sl_mat_get_step_bytes (void *ptr, enum SL_MEM mem) |
Gets the memory 'step' in bytes - how many bytes make up each row of pixels. More... | |
INTERFACE_API int | sl_mat_get_width_bytes (void *ptr) |
Gets the size of each row in bytes. More... | |
INTERFACE_API bool | sl_mat_is_memory_owner (void *ptr) |
Returns whether the Mat is the owner of the memory it's accessing. More... | |
INTERFACE_API struct SL_Resolution | sl_mat_get_resolution (void *ptr) |
Returns the resolution of the image that this Mat holds. 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 Mat. More... | |
INTERFACE_API int | sl_mat_set_from (void *ptr, void *ptr_source, enum SL_COPY_TYPE copy_type) |
Copies data from another Mat into this one(deep copy). More... | |
INTERFACE_API int * | sl_mat_get_ptr (void *ptr, enum SL_MEM mem) |
Gets a pointer to the Mat. More... | |
INTERFACE_API int | sl_mat_clone (void *ptr, void *ptr_source) |
Duplicates a Mat 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 Mat (only swaps the pointers, no data copy). More... | |
INTERFACE_API void sl_unload_instance | ( | int | camera_id | ) |
Forces unload of one instance.
camera_id | : id of the instance to unload. |
INTERFACE_API bool sl_find_usb_device | ( | enum USB_DEVICE | device | ) |
Checks usb devices connected. param device : type of device to find.
INTERFACE_API bool sl_create_camera | ( | int | camera_id | ) |
Creates a camera with resolution mode, fps and id for linux.
camera_id | : id of the camera to be added. |
verbose | : Enable verbose mode. |
INTERFACE_API bool sl_is_opened | ( | int | camera_id | ) |
Reports if the camera has been successfully opened.
camera_id | : id of the camera. |
INTERFACE_API int sl_open_camera | ( | int | camera_id, |
struct SL_InitParameters * | init_parameters, | ||
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 camera depending on the init parameters.
camera_id | : id of the camera. |
init_parameters | : structure containing all the initial parameters. |
path_svo | : filename of the svo (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 | : sdk verbose log file. Redirect the SDK verbose message to file. |
opt_settings_path | : optional settings path. Equivalent to InitParameters::optional_settings_path. |
opencv_calib_path | : optional openCV calibration file. Equivalent to InitParameters::optional_opencv_calibration_file. |
INTERFACE_API CUcontext sl_get_cuda_context | ( | int | camera_id | ) |
Gets the Camera-created CUDA context for sharing it with other CUDA-capable libraries.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_InitParameters* sl_get_init_parameters | ( | int | camera_id | ) |
Returns the initparameters used to open the ZED camera.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_RuntimeParameters* sl_get_runtime_parameters | ( | int | camera_id | ) |
Returns the Runtimeparameters used to open the ZED camera.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_PositionalTrackingParameters* sl_get_positional_tracking_parameters | ( | int | camera_id | ) |
Returns the PositionalTrackingParameters.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_close_camera | ( | int | camera_id | ) |
Destroys the camera and disable the textures.
camera_id | of the camera instance. |
INTERFACE_API int sl_set_region_of_interest | ( | int | camera_id, |
void * | roi_mask | ||
) |
Defines a region of interest to focus on for all the SDK, discarding other parts.
camera_id | of the camera instance. |
roi_mask | the Mat defining the requested region of interest, all pixel set to 0 will be discard. If empty, set all pixels as valid, otherwise should fit the resolution of the current instance and its type should be U8_C1. |
INTERFACE_API int sl_grab | ( | int | camera_id, |
struct SL_RuntimeParameters * | runtime | ||
) |
Grabs the lastest images from the camera.
camera_id | : id of the camera instance. |
runtime | : structure containing all the runtime parameters. |
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 function lists all the cameras available and provides their serial number, models and other information.
device_list | [Out] : the devices properties for each connected camera. |
nb_devices | [Out] : the number of cameras connected. |
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.
device_list | [Out] : the devices properties for each connected camera. |
nb_devices | [Out]: the number of cameras connected. |
INTERFACE_API int sl_reboot | ( | int | sn, |
bool | full_reboot | ||
) |
Performs an hardware reset of the ZED 2 / ZED 2i.
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) |
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.
camera_id | : id of the camera instance. |
filename | : filename of the SVO file. |
compression_mode | : compression mode. Can be one for the SL_SVO_COMPRESSION_MODE enum. |
bitrate | : overrides default bitrate of the SVO file, in KBits/s. Only works if 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. |
INTERFACE_API struct SL_RecordingStatus* sl_get_recording_status | ( | int | camera_id | ) |
Get the recording information.
INTERFACE_API void sl_disable_recording | ( | int | camera_id | ) |
Disables the recording initiated by enableRecording() and closes the generated file.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_RecordingParameters* sl_get_recording_parameters | ( | int | camera_id | ) |
Returns the recording parameters used. Correspond to the structure send when the sl_enable_recording() function was called.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_pause_recording | ( | int | camera_id, |
bool | status | ||
) |
Pauses or resumes the recording.
camera_id | : id of the camera instance. |
status | : if true, the recording is paused. If false, the recording is resumed. |
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.
camera_id | : id of the camera instance. |
area_file_path | : area localization file that describes the surroundings, saved from a previous tracking session. |
INTERFACE_API void sl_disable_positional_tracking | ( | int | camera_id, |
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.
camera_id | : id of the camera instance. |
initial_world_rotation | : rotation of the camera in the world frame when the camera is started. By default, it should be identity. |
initial_world_position | : position of the camera in the world frame when the camera is started. By default, it should be identity. |
enable_area_memory | : this mode enables the camera to remember its surroundings. This helps correct positional tracking drift, and can be helpful for positioning different cameras relative to one other in space. |
enable_pose_smoothing | : this mode enables smooth pose correction for small drift correction. |
set_floor_as_origin | : this mode initializes the tracking to be aligned with the floor plane to better position the camera in space. |
set_as_static | : this mode defines the camera as static. If true, it will not move in the environment. This allows you to set its position using initial_world_transform. |
enable_imu_fusion | : this mode enables or disables IMU fusion. When set to false, only the optical odometry will be used. |
area_file_path | : area localization file that describes the surroundings, saved from a previous tracking session. |
Disables the positional tracking.
camera_id | : id of the camera instance. |
area_file_path | : if set, saves the spatial memory into an '.area' file. |
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.
camera_id | : id of the camera instance. |
area_file_path | : save the spatial memory database in an '.area' file. |
INTERFACE_API int sl_get_area_export_state | ( | int | camera_id | ) |
Returns the state of the spatial memory export process.
camera_id | : id of the camera instance. |
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 grab() will read the provided frame number.
camera_id | : id of the camera instance. |
frame_number | : the number of the desired frame to be decoded. |
INTERFACE_API float sl_get_camera_fps | ( | int | camera_id | ) |
Returns the camera FPS.
camera_id | : id of the camera instance. |
INTERFACE_API float sl_get_current_fps | ( | int | camera_id | ) |
Returns the current FPS.
camera_id | : id of the camera instance. |
int INTERFACE_API sl_get_width | ( | int | camera_id | ) |
Returns the width of the current image.
camera_id | : id of the camera instance. |
int INTERFACE_API sl_get_height | ( | int | camera_id | ) |
Returns the height of the current image.
camera_id | : id of the camera instance. |
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).
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_CameraInformation* sl_get_camera_information | ( | int | camera_id, |
int | res_width, | ||
int | res_height | ||
) |
Returns the calibration parameters, serial number and other information about the camera being used.
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. |
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.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_CalibrationParameters* sl_get_calibration_parameters | ( | int | camera_id, |
bool | raw_params | ||
) |
Gets the Calibration Parameters.
camera_id | : id of the camera instance. |
raw_params | : if true, returns Intrinsic and Extrinsic stereo parameters for original images (unrectified/distorded), else returns parameters for rectified/undistorded images. |
INTERFACE_API struct SL_SensorsConfiguration* sl_get_sensors_configuration | ( | int | camera_id | ) |
Gets the Sensors configuration.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_get_camera_imu_transform | ( | int | camera_id, |
struct SL_Vector3 * | translation, | ||
struct SL_Quaternion * | rotation | ||
) |
Gets the IMU to Left camera transform matrix.
camera_id | : id of the camera instance. |
translation | : translation between IMU frame and camera frame. |
rotation | : rotation between IMU frame and camera frame. |
INTERFACE_API int sl_get_input_type | ( | int | camera_id | ) |
Gets the input type (see SL_INPUT_TYPE).
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_zed_serial | ( | int | camera_id | ) |
Gets the ZED Serial Number.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_camera_firmware | ( | int | camera_id | ) |
Gets the ZED camera Current Firmware version.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_sensors_firmware | ( | int | camera_id | ) |
Gets the ZED mcu Current Firmware version.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_camera_model | ( | int | camera_id | ) |
Gets the ZED Camera model (see SL_MODEL).
camera_id | : id of the camera instance. |
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. (should be called after a grab).
camera_id | : id of the camera instance. |
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.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_svo_number_of_frames | ( | int | camera_id | ) |
Gets the total number of frames in the loaded SVO file.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_set_camera_settings | ( | int | camera_id, |
enum SL_VIDEO_SETTINGS | mode, | ||
int | value | ||
) |
Sets a value in the ZED's camera settings.
camera_id | : id of the camera instance. |
mode | : Setting to be changed |
value | : new value |
INTERFACE_API int 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.
camera_id | : id of the camera instance. |
side | : defines left,right,both to distinguish between left and right or both sides (see SL_SIDE). |
roi | : Region of interest. |
reset | : reset aestruct C_agc if true. |
INTERFACE_API int sl_get_camera_settings | ( | int | camera_id, |
enum SL_VIDEO_SETTINGS | mode | ||
) |
Gets the value of a given setting from the ZED camera.
camera_id | : id of the camera instance. |
mode | : Setting to be retrieved (see SL_VIDEO_SETTINGS). |
Gets the region of interest for automatic exposure/gain computation.
camera_id | : id of the camera instance. |
side | : defines left,right,both to distinguish between left and right or both sides (see SL_SIDE). |
roi | [Out] : Region of interest. |
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).
camera_id | : id of the camera instance. |
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).
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_current_min_max_depth | ( | int | camera_id, |
float * | min, | ||
float * | max | ||
) |
Gets the current range of perceived depth.
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) |
INTERFACE_API int sl_get_number_zed_connected | ( | ) |
Gets the number of zed connected.
INTERFACE_API char* sl_get_sdk_version | ( | ) |
Returns the version of the currently installed ZED SDK.
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.
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_dest | the destination coordinate system for the translation/rotation. |
INTERFACE_API int sl_get_svo_position | ( | int | camera_id | ) |
Returns the version of the currently installed ZED SDK.
major | : major int of the version filled |
minor | : minor int of the version filled |
patch | : patch int of the version filled |
Gets the current position of the SVO being recorded to.
camera_id | : id of the camera instance. |
INTERFACE_API unsigned int sl_get_frame_dropped_count | ( | int | camera_id | ) |
Gets the number of frames dropped since Grab() was called for the first time. Based on camera timestamps and an FPS comparison.
camera_id | : id of the camera instance. |
INTERFACE_API bool sl_is_positional_tracking_enabled | ( | int | camera_id | ) |
Gets the current position of the camera and state of the tracking, with an optional offset to the tracking frame.
camera_id | : id of the camera instance. |
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.
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. |
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 PoseData struck useful for AR pass-though.
camera_id | : id of the camera instance. |
poseData | : Current Pose. |
reference_frame | : Reference frame sor setting the rotation/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.
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. |
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).
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). |
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.
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. |
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.
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. |
INTERFACE_API int sl_set_imu_prior_orientation | ( | int | camera_id, |
struct SL_Quaternion | rotation | ||
) |
Sets a prior to the IMU orientation (using a ZED-mini, ZED2 or ZED2i). 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.
rotation | : Prior rotation. \SUCCESS if the transform has been passed, ERROR_CODE::INVALID_FUNCTION_CALL otherwise |
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 ZED-M/ZED2 IMU. Returns an error if using ZED (v1) which does not contains internal sensors.
camera_id | : id of the camera instance. |
quat | [Out]: Rotation from the IMU. |
time_reference | : time reference. |
INTERFACE_API int sl_get_sensors_data | ( | int | camera_id, |
struct SL_SensorData * | data, | ||
enum SL_TIME_REFERENCE | time_reference | ||
) |
Gets the full Sensor data from the ZED-M/ZED2/ZED2i. Returns an error is using ZED (v1) which does not contains internal sensors.
camera_id | : id of the camera instance. |
data | : sensor data. |
time_reference | : time reference. |
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).
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 submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_updated_submeshes | : Number of submeshes. |
updates_indices | : List of all submeshes updated since the last update. |
nb_vertices_tot | : Total number of updated vertices in all submeshes. |
nb_triangles_tot | : Total number of updated triangles in all submeshes. |
max_sub_mesh | : Maximum number of submeshes. |
INTERFACE_API int sl_enable_spatial_mapping | ( | int | camera_id, |
struct SL_SpatialMappingParameters * | mapping_param | ||
) |
Initializes and begins the spatial mapping processes.
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. |
INTERFACE_API void sl_disable_spatial_mapping | ( | int | camera_id | ) |
Disables the Spatial Mapping process.
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_SpatialMappingParameters* sl_get_spatial_mapping_parameters | ( | int | camera_id | ) |
Returns the spatial mapping parameters used. Correspond to the structure send when the enableSpatialMapping() function was called.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_pause_spatial_mapping | ( | int | camera_id, |
bool | status | ||
) |
Sets the pause state of the data integration mechanism for the ZED's spatial mapping.
camera_id | : id of the camera instance. |
status | : If true, the integration is paused. If false, the spatial mapping is resumed. |
INTERFACE_API void sl_request_mesh_async | ( | int | camera_id | ) |
Starts the mesh generation process in a thread that doesn't block the spatial mapping process.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_get_mesh_request_status_async | ( | int | camera_id | ) |
Returns the mesh generation status. Useful for knowing when to update and retrieve the mesh.
camera_id | : id of the camera instance. |
INTERFACE_API enum SL_SPATIAL_MAPPING_STATE sl_get_spatial_mapping_state | ( | int | camera_id | ) |
Gets the current state of spatial mapping.
camera_id | : id of the camera instance. |
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.
camera_id | : id of the camera instance. |
nb_vertices | : Array of the number of vertices in each submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_submeshes | : Number of submeshes. |
updates_indices | : List of all submeshes updated since the last update. |
num_vertices_tot | : Total number of updated vertices in all submeshes. |
num_triangles_tot | : Total number of updated triangles in all submeshes. |
max_sub_mesh | : Maximum number of submeshes. |
INTERFACE_API int sl_retrieve_mesh | ( | int | camera_id, |
float * | vertices, | ||
int * | triangles, | ||
float * | uvs, | ||
unsigned char * | texture_ptr, | ||
const int | max_submeshes | ||
) |
Retrieves all chunks of the current 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 nb_triangles).
camera_id | : id of the camera instance. |
vertices | : Vertices of the mesh |
triangles | : Triangles of the mesh. |
max_submeshes | : Maximum number of submesh that can be handled. |
uvs | : uvs of the texture. |
texture_ptr | : Texture of the mesh (if enabled). |
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.
camera_id | : id of the camera instance. |
nb_vertices | : Array of the number of vertices in each submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_submeshes | : Number of submeshes. |
updates_indices | : List of all submeshes updated since the last update. |
num_vertices_tot | : Total number of updated vertices in all submeshes. |
num_triangles_tot | : Total number of updated triangles in all submeshes. |
max_sub_mesh | : Maximum number of submeshes. |
INTERFACE_API int sl_retrieve_chunks | ( | int | camera_id, |
float * | vertices, | ||
int * | triangles, | ||
float * | uvs, | ||
unsigned char * | texture_ptr, | ||
const int | max_submesh | ||
) |
Retrieves all chunks of the full mesh. Call update_mesh before calling this. Vertex and triangles arrays must be at least of the sizes returned by update_mesh (nbVertices and nbTriangles).
camera_id | : id of the camera instance. |
max_submesh | : Maximum number of submesh that can be handled. |
vertices | : Vertices of the chunk |
triangles | : Triangles of the chunk. |
uvs | : uvs of the texture. |
texture_ptr | : Texture of the mesh (if enabled). |
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 FUSED_POINT_CLOUD).
camera_id | : id of the camera instance. |
num_vertices_tot | : returns the total number of vertices. |
INTERFACE_API int sl_retrieve_fused_point_cloud | ( | int | camera_id, |
float * | vertices | ||
) |
Retrieves all points of the fused point cloud. Call update_fused_point_cloud before calling this.
camera_id | : id of the camera instance. |
vertices | : Points of the fused point cloud. |
INTERFACE_API int sl_extract_whole_spatial_map | ( | int | camera_id | ) |
Extracts the current spatial map from the spatial mapping process.
camera_id | : id of the camera instance. SUCCESS if the mesh is filled and available, otherwise FAILURE. |
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.
camera_id | : id of the camera instance. |
filename | : Path and filename of the mesh. |
format | : File format (extension). Can be .obj, .ply or .bin. |
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.
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. |
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.
camera_id | : id of the camera instance. |
filename | : Path and filename of the mesh. Should incluse the extension (.obj, .ply or .bin). |
nb_ertices | : Array of the number of vertices in each submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_sub_meshes | : Number of submeshes. |
updated_indices | : List of all submeshes updated since the last update. |
nb_vertices_tot | : Total number of updated vertices in all submeshes. |
nb_triangles_tot | : Array of the number of triangles in each submesh. |
max_submesh | : Maximum number of submeshes taht can be handled. |
texture_size | : Array containing the sizes of all the textures (width ,height) if applicable. |
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.
camera_id | : id of the camera instance. |
nb_vertices | : Array of the number of vertices in each submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_sub_meshes | : Number of submeshes. |
updated_indices | : List of all submeshes updated since the last update. |
nb_vertices_tot | : Total number of updated vertices in all submeshes. |
nb_triangles_tot | : Array of the number of triangles in each submesh. |
max_submesh | : Maximum number of submeshes taht can be handled. |
texture_size | : Array containing the sizes of all the textures (width ,height) if applicable. |
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).
camera_id | : id of the camera instance. |
filter_params | : Filter level. Higher settings remore more triangles (SL_MeshFilterParameters::MESH_FILTER). |
nb_vertices | : Array of the number of vertices in each submesh. |
nb_triangles | : Array of the number of triangles in each submesh. |
nb_sub_meshes | : Number of submeshes. |
updated_indices | : List of all submeshes updated since the last update. |
nb_vertices_tot | : Total number of updated vertices in all submeshes. |
nb_triangles_tot | : Array of the number of triangles in each submesh. |
max_submesh | : Maximum number of submeshes that can be handled. |
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 the ZED_M /ZED2, this isn't required thanks to its IMU.
camera_id | : id of the camera instance. |
gravity | [Out] : vector of gravity. |
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.
camera_id | : id of the camera instance. |
nb_vertices | : Total number of updated vertices in all submeshes. |
nb_triangles | : Total number of updated triangles in all submeshes. |
INTERFACE_API int sl_retrieve_whole_mesh | ( | int | camera_id, |
float * | vertices, | ||
int * | triangles, | ||
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).
camera_id | : id of the camera instance. |
vertices | : Vertices of the chunk |
triangles | : Triangles of the chunk. |
uvs | : uvs of the texture. |
texture_ptr | : Texture of the mesh (if enabled). |
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.
camera_id | : id of the camera instance. |
filename | : Path and filename of the mesh. Should incluse the extension (.obj, .ply or .bin). |
nb_vertices | : Total number of updated vertices in all submeshes. |
nb_triangles | : Array of the number of triangles in each submesh. |
max_submesh | : Maximum number of submeshes taht can be handled. |
texture_size | : Array containing the sizes of all the textures (width ,height) if applicable. |
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.
camera_id | : id of the camera instance. |
nb_vertices | : Total number of updated vertices in all submeshes. |
nb_triangles | : Array of the number of triangles in each submesh. |
texture_size | : Array containing the sizes of all the textures (width ,height) if applicable. |
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).
camera_id | : id of the camera instance. |
nb_vertices | : Total number of updated vertices in all submeshes. |
nb_triangles | : Array of the number of triangles in each submesh. |
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 | ||
) |
Looks for a plane in the visible area that is likely to represent the floor.
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. |
INTERFACE_API struct SL_PlaneData* sl_find_plane_at_hit | ( | int | camera_id, |
struct SL_Vector2 | pixel, | ||
bool | thres | ||
) |
Check for a plane in hte real world at given screen-space coordinates.
camera_id | : id of the camera instance. |
pixel | : Point on the ZED image to check for a plane. |
thres | : Check if area is enough for Unity. If true, removes smaller planes. |
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.
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). |
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.
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). |
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.
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. |
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.
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. |
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.
image_in | : input image to convert |
image_signed | : output image to converted |
stream | : a cuda stream to put the compute to (def. 0) |
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.
camera_id | : id of the camera instance. | ||||||||||||||||||||||||||||
codec | : defines the codec used for streaming (see SL_STREAMING_CODE). | ||||||||||||||||||||||||||||
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. |
INTERFACE_API void sl_disable_streaming | ( | int | camera_id | ) |
Disables the streaming initiated by enable_streaming().
camera_id | : id of the camera instance. |
INTERFACE_API int sl_is_streaming_enabled | ( | int | camera_id | ) |
Tells if the streaming is running (true) or still initializing (false).
camera_id | : id of the camera instance. |
INTERFACE_API struct SL_StreamingParameters* sl_get_streaming_parameters | ( | int | camera_id | ) |
Returns the streaming parameters used. Correspond to the structure send when the sl_enable_streaming() function was called.
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.
camera_id | : id of the camera instance. |
view | : View of the image (SL_VIEW). |
file_name | : file path including the name and extension. |
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.
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. |
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.
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. |
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.
model | : AI model to check. |
gpu_id | : ID of the gpu. |
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.
model | : AI model to optimize. |
gpu_id | : ID of the gpu to optimize on. |
INTERFACE_API int sl_enable_objects_detection | ( | int | camera_id, |
struct SL_ObjectDetectionParameters * | object_detection_parameters | ||
) |
Initializes and starts the Deep Learning detection module.
The object detection module currently supports two types of detection :
Detected objects can be retrieved using the retrieve_objects() function.
camera_id | : id of the camera instance. |
object_detection_parameters | : structure containing all specific parameters for object detection (see SL_ObjectDetectionParameters). |
INTERFACE_API struct SL_ObjectDetectionParameters* sl_get_object_detection_parameters | ( | int | cmaera_id | ) |
Returns the object detection parameters used. Correspond to the structure send when the enableObjectDetection() function was called.
camera_id | : id of the camera instance. |
INTERFACE_API void sl_pause_objects_detection | ( | int | camera_id, |
bool | status | ||
) |
Pauses or resumes the object detection processes.
If the object detection has been enabled with ObjectDetectionParameters::image_sync set to false (running asynchronously), this function will pause processing.
While in pause, calling this function with status = false will resume the object detection. The retrieveObjects function will keep on returning the last objects detected while in pause.
status | : If true, object detection is paused. If false, object detection is resumed. |
INTERFACE_API void sl_disable_objects_detection | ( | int | camera_id | ) |
Disables the Object Detection process.
The object detection module immediately stops and frees its memory allocations.
camera_id | : id of the camera instance. |
INTERFACE_API int sl_generate_unique_id | ( | char * | uuid | ) |
Generate a UUID like unique ID to help identify and track AI detections.
uuid | : Unique ID generated. |
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.
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). |
INTERFACE_API int sl_retrieve_objects | ( | int | camera_id, |
struct SL_ObjectDetectionRuntimeParameters * | object_detection_runtime_parameters, | ||
struct SL_Objects * | objects | ||
) |
Retrieve objects detected by the object detection module.
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. |
INTERFACE_API int sl_update_objects_batch | ( | int | camera_id, |
int * | nb_batches | ||
) |
Updates the internal batch of detected objects.
camera_id | : id of the camera instance. |
[Out] | : number of batches. |
INTERFACE_API int sl_get_objects_batch | ( | int | camera_id, |
int | index, | ||
struct SL_ObjectsBatch * | objs_batch | ||
) |
Gets a batch of detected objects. Need to be called after update_objects_batch().
camera_id | : id of the camera instance. |
index | : index of the batch to retrieve ([0, nb_batches]). |
nb_data | : number of detected objects in the batch. |
id | : The trajectory ID. |
label | : Object Category. Identify the object type (SL_OBJECT_CLASS). |
sublabel | : Object subclass (SL_OBJECT_SUBCLASS). |
tracking_state | : defines the object tracking state (SL_OBJECT_TRACKING_STATE). |
positions | : a sample of 3D positions. |
position_covariances | : a sample of the associated position covariances. |
velocities | : a sample of 3D velocity. |
timestamps | : The associated position timestamp. |
bounding_boxes_2d | : 2D bounding box of the person represented as four 2D points starting at the top left corner and rotation clockwise. Expressed in pixels on the original image resolution, [0,0] is the top left corner. A ---— B | Object | D ---— C |
bounding_box | : a sample of 3d bounding boxes. |
confidences | : a sample of object detection confidence. |
action_states | : a sample of object action state (SL_OBJECT_ACTION_STATE). |
keypoints_2d | : a sample of 2d position keypoints. Not available with DETECTION_MODE::MULTI_CLASS_BOX. |
keypoints | : a sample of 3d position keypoints. Not available with DETECTION_MODE::MULTI_CLASS_BOX. |
head_bounding_boxes_2d | : bounds the head with four 2D points. Not available with DETECTION_MODE::MULTI_CLASS_BOX. |
head_bounding_boxes | : bounds the head with eight 3D points. Not available with DETECTION_MODE::MULTI_CLASS_BOX. |
head_positions | : 3D head centroids. |
keypoint_confidences | : Per keypoint detection confidence, can not be lower than the ObjectDetectionRuntimeParameters::detection_confidence_threshold. Not available with DETECTION_MODEL::MULTI_CLASS_BOX. |
INTERFACE_API void* sl_mat_create_new | ( | int | width, |
int | height, | ||
enum SL_MAT_TYPE | type, | ||
enum SL_MEM | mem | ||
) |
Creates a Mat with the given resolution.
width | : width of the new mat. |
height | : height of the new mat. |
type | : Data type and number of channels the Mat will hold (see SL_MAT_TYPE). |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API void* sl_mat_create_new_empty | ( | ) |
Creates an empty Mat with the given resolution.
INTERFACE_API bool sl_mat_is_init | ( | void * | ptr | ) |
Tells if the Mat has been initialized.
ptr | : Ptr to the Mat. |
INTERFACE_API void sl_mat_free | ( | void * | ptr, |
enum SL_MEM | mem | ||
) |
Frees the memory of the Mat.
ptr | : Ptr to the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API void sl_mat_get_infos | ( | void * | ptr, |
char * | buffer | ||
) |
Returns information about the Mat.
ptr | : Ptr to the Mat. |
buffer | : buffer providing Mat information. |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | [Out] : the value to get. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
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.
ptr | : Ptr to the Mat. |
col | : specifies the column. |
row | : specifices the row. |
value | : the value to be set. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_set_to_uchar | ( | void * | ptr, |
unsigned char | value, | ||
enum SL_MEM | mem | ||
) |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_set_to_float | ( | void * | ptr, |
float | value, | ||
enum SL_MEM | mem | ||
) |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_set_to_float2 | ( | void * | ptr, |
struct SL_Vector2 | value, | ||
enum SL_MEM | mem | ||
) |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_set_to_float3 | ( | void * | ptr, |
struct SL_Vector3 | value, | ||
enum SL_MEM | mem | ||
) |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_set_to_float4 | ( | void * | ptr, |
struct SL_Vector4 | value, | ||
enum SL_MEM | mem | ||
) |
Fills the entire Mat with the given value.
ptr | : Ptr to the Mat. |
value | : the value with which to fill the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int sl_mat_update_cpu_from_gpu | ( | void * | ptr | ) |
Copies data from the GPU to the CPU, if possible.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_update_gpu_from_cpu | ( | void * | ptr | ) |
Copies data from the CPU to the GPU, if possible.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_copy_to | ( | void * | ptr, |
void * | ptr_dest, | ||
enum SL_COPY_TYPE | cpy_type | ||
) |
Copies data from this Mat to another Mat (deep copy).
ptr | : Ptr to the Source Mat. |
ptr_dest | : Ptr to the Destination Mat. |
cpy_type | : The To and From memory types (see SL_COPY_TYPE). |
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 Mat has access to MEM_CPU.
ptr | : Ptr to the Mat. |
file_path | : File path, including file name and extension. |
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.
ptr | : Ptr to the Mat. |
file_path | : File path, including file name and extension. |
INTERFACE_API int sl_mat_get_width | ( | void * | ptr | ) |
Gets the Width of the matrix.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_height | ( | void * | ptr | ) |
Gets the Height of the matrix.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_channels | ( | void * | ptr | ) |
Gets the number of channels stored in each pixel.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_memory_type | ( | void * | ptr | ) |
Gets the type of memory (CPU and/or GPU).
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_data_type | ( | void * | ptr | ) |
Gets the type of data (Mat_Type).
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_pixel_bytes | ( | void * | ptr | ) |
Gets the size in bytes of one pixel.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_step | ( | void * | ptr, |
enum SL_MEM | mem | ||
) |
Gets the memory 'step' in number/length of elements - how many values make up each row of pixels.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_step_bytes | ( | void * | ptr, |
enum SL_MEM | mem | ||
) |
Gets the memory 'step' in bytes - how many bytes make up each row of pixels.
ptr | : Ptr to the Mat. |
INTERFACE_API int sl_mat_get_width_bytes | ( | void * | ptr | ) |
Gets the size of each row in bytes.
ptr | : Ptr to the Mat. |
INTERFACE_API bool sl_mat_is_memory_owner | ( | void * | ptr | ) |
Returns whether the Mat is the owner of the memory it's accessing.
INTERFACE_API struct SL_Resolution sl_mat_get_resolution | ( | void * | ptr | ) |
Returns the resolution of the image that this Mat holds.
ptr | : Ptr to the Mat. |
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 Mat.
ptr | : Ptr to the Mat. |
width | : Width of the image/matrix in pixels. |
height | : Height of the image/matrix in pixels. |
type | : Data type and number of channels the Mat will hold (see SL_MAT_TYPE). |
mem | : Whether Mat should exist on CPU or GPU memory ( SL_MEM). |
INTERFACE_API int sl_mat_set_from | ( | void * | ptr, |
void * | ptr_source, | ||
enum SL_COPY_TYPE | copy_type | ||
) |
Copies data from another Mat into this one(deep copy).
ptr | : Ptr to the Mat. |
ptr_srouce | : Source Mat from which to copy. |
copy_type | : The To and From memory types (SL_COPY_TYPE). |
mem | : Whether Mat should exist on CPU or GPU memory (SL_MEM). |
INTERFACE_API int* sl_mat_get_ptr | ( | void * | ptr, |
enum SL_MEM | mem | ||
) |
Gets a pointer to the Mat.
ptr | : Ptr to the Mat. |
mem | : Whether Mat should exist on CPU or GPU memory ( SL_MEM). |
INTERFACE_API int sl_mat_clone | ( | void * | ptr, |
void * | ptr_source | ||
) |
Duplicates a Mat by copying all its data into a new one (deep copy).
ptr | : Ptr to the Mat. |
ptr_srouce | : Source Mat from which to copy. |
INTERFACE_API void sl_mat_swap | ( | void * | ptr_1, |
void * | ptr_2 | ||
) |
Swaps the content of the provided Mat (only swaps the pointers, no data copy).
ptr1 | : Ptr to the first Mat. |
ptr2 | : Ptr to the second Mat. |