zed_interface.h
Go to the documentation of this file.
1 #ifndef __INTERFACE_ZED_H
2 #define __INTERFACE_ZED_H
3 
4 #include "types_c.h"
5 #include <stdbool.h>
6 #include <cuda.h>
7 #include <cuda_runtime.h>
8 
13  //#define DEBUG
14 #ifdef _WIN32
15 #ifdef INTERFACE_NOEXPORT
16 #define INTERFACE_API
17 #else
18 #ifdef INTERFACE_EXPORT
19 #define INTERFACE_API __declspec(dllexport)
20 #else
21 #define INTERFACE_API __declspec(dllimport)
22 #endif
23 #endif
24 #else
25 #define INTERFACE_API
26 #endif
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
39  INTERFACE_API void sl_free(void* ptr);
40 
44  INTERFACE_API void sl_unload_all_instances();
45 
50  INTERFACE_API void sl_unload_instance(int camera_id);
51 
58  INTERFACE_API bool sl_create_camera(int camera_id);
59 
65  INTERFACE_API void* sl_get_camera_handle(int camera_id);
66 
72  INTERFACE_API bool sl_is_opened(int camera_id);
73 
90  INTERFACE_API int sl_open_camera(int camera_id, struct SL_InitParameters* init_parameters, const unsigned int serial_number, const char* path_svo, const char* ip,
91  int stream_port, int bus_port, const char* output_file, const char* opt_settings_path, const char* opencv_calib_path);
92 
102  INTERFACE_API int sl_open_camera_from_camera_id(int camera_id, struct SL_InitParameters* init_parameters, const char* output_file, const char* opt_settings_path, const char* opencv_calib_path);
103 
114  INTERFACE_API int sl_open_camera_from_serial_number(int camera_id, struct SL_InitParameters* init_parameters, const unsigned int serial_number, const char* output_file,
115  const char* opt_settings_path, const char* opencv_calib_path);
116 
127  INTERFACE_API int sl_open_camera_from_svo_file(int camera_id, struct SL_InitParameters* init_parameters, const char* path_svo, const char* output_file, const char* opt_settings_path, const char* opencv_calib_path);
128 
140  INTERFACE_API int sl_open_camera_from_stream(int camera_id, struct SL_InitParameters* init_parameters, const char* ip, int stream_port, const char* output_file, const char* opt_settings_path, const char* opencv_calib_path);
149  INTERFACE_API enum SL_ERROR_CODE sl_start_publishing(int camera_id, struct SL_CommunicationParameters* comm_params);
150 
156  INTERFACE_API enum SL_ERROR_CODE sl_stop_publishing(int camera_id);
157 
164  INTERFACE_API CUcontext sl_get_cuda_context(int camera_id);
165 
175  INTERFACE_API struct SL_InitParameters* sl_get_init_parameters(int camera_id);
176 
186  INTERFACE_API struct SL_RuntimeParameters* sl_get_runtime_parameters(int camera_id);
187 
198 
203  INTERFACE_API void sl_close_camera(int camera_id);
204 
213  INTERFACE_API int sl_set_region_of_interest(int camera_id, void* roi_mask, bool module[SL_MODULE_LAST]);
214 
223  INTERFACE_API int sl_get_region_of_interest(int camera_id, void* roi_mask, int width, int height, enum SL_MODULE module);
239  INTERFACE_API int sl_start_region_of_interest_auto_detection(int camera_id, struct SL_RegionOfInterestParameters* roi_param);
253  INTERFACE_API int sl_grab(int camera_id, struct SL_RuntimeParameters* runtime);
254 
265  INTERFACE_API int sl_read(int camera_id);
266 
274  INTERFACE_API void sl_get_device_list(struct SL_DeviceProperties device_list[MAX_CAMERA_PLUGIN], int* nb_devices);
275 
282  INTERFACE_API void sl_get_streaming_device_list(struct SL_StreamingProperties streaming_device_list[MAX_CAMERA_PLUGIN], int* nb_devices);
283 
294  INTERFACE_API int sl_reboot(int sn, bool full_reboot);
295 
312  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,
313  unsigned char encryption_key[256], enum SL_SVO_ENCODING_PRESET encoding_preset);
314 
323  INTERFACE_API int sl_enable_recording_from_params(int camera_id, struct SL_RecordingParameters* recording_parameters);
324 
331  INTERFACE_API struct SL_RecordingStatus* sl_get_recording_status(int camera_id);
336  INTERFACE_API void sl_disable_recording(int camera_id);
337 
347  INTERFACE_API struct SL_RecordingParameters* sl_get_recording_parameters(int camera_id);
348 
354  INTERFACE_API void sl_pause_recording(int camera_id, bool status);
355 
364  INTERFACE_API enum SL_ERROR_CODE sl_ingest_data_into_svo(int camera_id, struct SL_SVOData* data);
365 
377  INTERFACE_API int sl_get_svo_data_size(int camera_id, char key[128], unsigned long long ts_begin, unsigned long long ts_end);
378 
391  INTERFACE_API enum SL_ERROR_CODE sl_retrieve_svo_data(int camera_id, char* key, int nb_data, struct SL_SVOData** data, unsigned long long ts_begin, unsigned long long ts_end);
392 
399  INTERFACE_API int sl_get_svo_data_keys_size(int camera_id);
400 
410  INTERFACE_API void sl_get_svo_data_keys(int camera_id, int nb_keys, char** keys);
411 
423  INTERFACE_API int sl_enable_positional_tracking(int camera_id, struct SL_PositionalTrackingParameters* tracking_param, const char* area_file_path);
424 
425  // /**
426  // \brief Initializes and starts the positional tracking processes.
427  // This function allows you to enable the position estimation of the SDK. It only has to be called once in the camera's lifetime.
428  //
429  // \param camera_id : id of the camera instance.
430  // \param initial_world_rotation : rotation of the camera in the world frame when the camera is started. By default, it should be identity.
431  // \param initial_world_position : position of the camera in the world frame when the camera is started. By default, it should be identity.
432  // \param 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.
433  // \param enable_pose_smoothing : this mode enables smooth pose correction for small drift correction.
434  // \param set_floor_as_origin : this mode initializes the tracking to be aligned with the floor plane to better position the camera in space.
435  // \param 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.
436  // \param enable_imu_fusion : this mode enables or disables IMU fusion. When set to false, only the optical odometry will be used.
437  // \param area_file_path : area localization file that describes the surroundings, saved from a previous tracking session.
438  // \return \ref SL_ERROR_CODE::SUCCESS if everything went fine, ERROR_CODE::FAILURE otherwise.
439  // */
440  // /**INTERFACE_API int enable_positional_tracking(int camera_id, struct SL_Quaternion *initial_world_rotation, struct SL_Vector3 *initial_world_position, bool enable_area_memory, bool enable_pose_smoothing, bool set_floor_as_origin, bool set_as_static,
441  // bool enable_imu_fusion, const char* area_file_path);*/
442 
448  INTERFACE_API void sl_disable_positional_tracking(int camera_id, const char* area_file_path);
449 
456  INTERFACE_API int sl_save_area_map(int camera_id, const char* area_file_path);
457 
465  INTERFACE_API int sl_get_area_export_state(int camera_id);
466 
476  INTERFACE_API enum SL_ERROR_CODE sl_set_svo_position(int camera_id, int position);
477 
484  INTERFACE_API void sl_pause_svo_reading(int camera_id, bool status);
485 
491  INTERFACE_API float sl_get_camera_fps(int camera_id);
492 
498  INTERFACE_API float sl_get_current_fps(int camera_id);
499 
505  int INTERFACE_API sl_get_width(int camera_id);
506 
512  int INTERFACE_API sl_get_height(int camera_id);
513 
519  INTERFACE_API int sl_get_confidence_threshold(int camera_id);
520 
532  INTERFACE_API struct SL_CameraInformation* sl_get_camera_information(int camera_id, int res_width, int res_height);
533 
540  INTERFACE_API void sl_update_self_calibration(int camera_id);
541 
550  INTERFACE_API struct SL_CalibrationParameters* sl_get_calibration_parameters(int camera_id, bool raw_params);
551 
559  INTERFACE_API struct SL_SensorsConfiguration* sl_get_sensors_configuration(int camera_id);
560 
572  INTERFACE_API void sl_get_camera_imu_transform(int camera_id, struct SL_Vector3* translation, struct SL_Quaternion* rotation);
573 
579  INTERFACE_API int sl_get_input_type(int camera_id);
580 
586  INTERFACE_API int sl_get_zed_serial(int camera_id);
587 
593  INTERFACE_API int sl_get_camera_firmware(int camera_id);
594 
600  INTERFACE_API int sl_get_sensors_firmware(int camera_id);
601 
607  INTERFACE_API int sl_get_camera_model(int camera_id);
608 
616  INTERFACE_API unsigned long long sl_get_image_timestamp(int camera_id);
617 
625  INTERFACE_API unsigned long long sl_get_current_timestamp(int camera_id);
626 
636  INTERFACE_API unsigned long long sl_get_timestamp(int camera_id, enum SL_TIME_REFERENCE time_reference);
637 
642  INTERFACE_API void sl_set_timestamp_clock(enum SL_TIMESTAMP_CLOCK clock);
643 
649 
654  INTERFACE_API void sl_set_max_system_clock_step_ms(float limit_ms);
655 
660  INTERFACE_API float sl_get_max_system_clock_step_ms();
661 
667  INTERFACE_API int sl_get_svo_number_of_frames(int camera_id);
668 
675  INTERFACE_API bool sl_is_camera_setting_supported(int camera_id, enum SL_VIDEO_SETTINGS setting);
676 
685  INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings(int camera_id, enum SL_VIDEO_SETTINGS mode, int value);
686 
701  INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings_min_max(int camera_id, enum SL_VIDEO_SETTINGS mode, int min, int max);
702 
715  INTERFACE_API enum SL_ERROR_CODE sl_set_roi_for_aec_agc(int camera_id, enum SL_SIDE side, struct SL_Rect* roi, bool reset);
716 
726  INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings(int c_id, enum SL_VIDEO_SETTINGS mode, int* value);
727 
737  INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings_min_max(int c_id, enum SL_VIDEO_SETTINGS mode, int* minvalue, int* maxvalue);
738 
750  INTERFACE_API enum SL_ERROR_CODE sl_get_roi_for_aec_agc(int id, enum SL_SIDE side, struct SL_Rect* roi);
751 
757  INTERFACE_API float sl_get_depth_min_range_value(int camera_id);
758 
764  INTERFACE_API float sl_get_depth_max_range_value(int camera_id);
765 
773  INTERFACE_API int sl_get_current_min_max_depth(int camera_id, float* min, float* max);
774 
779  INTERFACE_API int sl_get_number_zed_connected();
780 
786  INTERFACE_API char* sl_get_sdk_version();
787 
795  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);
796 
797  // /**
798  // \brief Returns the version of the currently installed ZED SDK.
799  // \param major : major int of the version filled
800  // \param minor : minor int of the version filled
801  // \param patch : patch int of the version filled
802  // */
803  // INTERFACE_API void sl_get_sdk_version(int *major, int *minor, int *patch);
804 
810  INTERFACE_API int sl_get_svo_position(int camera_id);
811 
822  INTERFACE_API int sl_get_svo_position_at_timestamp(int camera_id, unsigned long long timestamp);
823 
829  INTERFACE_API unsigned int sl_get_frame_dropped_count(int camera_id);
830 
838  INTERFACE_API struct SL_HealthStatus* sl_get_health_status(int camera_id);
839 
848  INTERFACE_API struct SL_Resolution* sl_get_retrieve_image_resolution(int camera_id, struct SL_Resolution* res);
849 
858  INTERFACE_API struct SL_Resolution* sl_get_retrieve_measure_resolution(int camera_id, struct SL_Resolution* res);
862 
867  INTERFACE_API bool sl_is_positional_tracking_enabled(int camera_id);
868 
879  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);
887  INTERFACE_API int sl_get_position_data(int camera_id, struct SL_PoseData* poseData, enum SL_REFERENCE_FRAME reference_frame);
896  INTERFACE_API int sl_get_position(int camera_id, struct SL_Quaternion* rotation, struct SL_Vector3* position, enum SL_REFERENCE_FRAME reference_frame);
904  INTERFACE_API int sl_get_position_array(int camera_id, float* pose, enum SL_REFERENCE_FRAME reference_frame);
905 
914  INTERFACE_API int sl_get_positional_tracking_landmarks(int camera_id, struct SL_Landmark** landmarks, uint32_t* count);
915 
924  INTERFACE_API int sl_get_positional_tracking_landmarks_2d(int camera_id, struct SL_Landmark2D** landmarks2d, uint32_t* count);
932 
940  INTERFACE_API int sl_reset_positional_tracking(int camera_id, struct SL_Quaternion rotation, struct SL_Vector3 translation);
950  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);
963  INTERFACE_API int sl_set_imu_prior_orientation(int camera_id, struct SL_Quaternion rotation);
975  INTERFACE_API int sl_get_imu_orientation(int camera_id, struct SL_Quaternion* quat, enum SL_TIME_REFERENCE time_reference);
987  INTERFACE_API int sl_get_sensors_data(int camera_id, struct SL_SensorsData* data, enum SL_TIME_REFERENCE time_reference);
988 
998  INTERFACE_API int sl_get_sensors_data_batch_count(int camera_id, int* count);
1012  INTERFACE_API int sl_get_sensors_data_batch(int camera_id, struct SL_SensorsData** data);
1013 
1017 
1031  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);
1032 
1043  INTERFACE_API int sl_enable_spatial_mapping(int camera_id, struct SL_SpatialMappingParameters* mapping_param);
1048  INTERFACE_API void sl_disable_spatial_mapping(int camera_id);
1049 
1065  INTERFACE_API void sl_pause_spatial_mapping(int camera_id, bool status);
1070  INTERFACE_API void sl_request_mesh_async(int camera_id);
1078  INTERFACE_API int sl_get_mesh_request_status_async(int camera_id);
1086  INTERFACE_API enum SL_SPATIAL_MAPPING_STATE sl_get_spatial_mapping_state(int camera_id);
1099  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);
1114  INTERFACE_API int sl_retrieve_mesh(int camera_id, float* vertices, int* triangles, unsigned char* colors, float* uvs, unsigned char* texture_ptr, const int max_submeshes);
1127  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);
1142  INTERFACE_API int sl_retrieve_chunks(int camera_id, float* vertices, int* triangles, unsigned char* colors, float* uvs, unsigned char* texture_ptr, const int max_submesh);
1143 
1150  INTERFACE_API int sl_update_fused_point_cloud(int camera_id, int* nb_vertices_tot);
1158  INTERFACE_API int sl_retrieve_fused_point_cloud(int camera_id, float* vertices);
1164  INTERFACE_API int sl_extract_whole_spatial_map(int camera_id);
1172  INTERFACE_API bool sl_save_mesh(int camera_id, const char* filename, enum SL_MESH_FILE_FORMAT format);
1180  INTERFACE_API bool sl_save_point_cloud(int c_id, const char* filename, enum SL_MESH_FILE_FORMAT format);
1195  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);
1209  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);
1223  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);
1231  INTERFACE_API void sl_spatial_mapping_get_gravity_estimation(int camera_id, struct SL_Vector3* gravity);
1232 
1233 
1235 
1243  INTERFACE_API int sl_update_whole_mesh(int camera_id, int* nb_vertices, int* nb_triangles);
1255  INTERFACE_API int sl_retrieve_whole_mesh(int camera_id, float* vertices, int* triangles, unsigned char* colors, float* uvs, unsigned char* texture_ptr);
1266  INTERFACE_API bool sl_load_whole_mesh(int camera_id, const char* filename, int* nb_vertices, int* nb_triangles, int* texture_size);
1275  INTERFACE_API bool sl_apply_whole_texture(int camera_id, int* nb_vertices, int* nb_triangles, int* texture_size);
1283  INTERFACE_API bool sl_filter_whole_mesh(int camera_id, enum SL_MESH_FILTER filter_params, int* nb_vertices, int* nb_triangles);
1284 
1285 
1289 
1299  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);
1308  INTERFACE_API struct SL_PlaneData* sl_find_plane_at_hit(int camera_id, struct SL_Vector2 pixel, struct SL_PlaneDetectionParameters* params, bool thres);
1318  INTERFACE_API int sl_convert_floorplane_to_mesh(int camera_id, float* vertices, int* triangles, int* nb_vertices_tot, int* nb_triangles_tot);
1328  INTERFACE_API int sl_convert_hitplane_to_mesh(int camera_id, float* vertices, int* triangles, int* nb_vertices_tot, int* nb_triangles_tot);
1329 
1330 
1334 
1351  INTERFACE_API int sl_retrieve_measure(int camera_id, void* measure_ptr, enum SL_MEASURE type, enum SL_MEM mem, int width, int height, void* custream);
1352 
1366  INTERFACE_API int sl_retrieve_voxel_measure(int camera_id, void* measure_ptr, enum SL_MEASURE type, enum SL_MEM mem, struct SL_VoxelMeasureParameters* params, void* stream);
1367 
1381  INTERFACE_API int sl_retrieve_image(int camera_id, void* image_ptr, enum SL_VIEW type, enum SL_MEM mem, int width, int height, void* custream);
1382 
1390  INTERFACE_API int sl_convert_image(void* image_in_ptr, void* image_signed_ptr, void* stream);
1391 
1395 
1417  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);
1418 
1423  INTERFACE_API void sl_disable_streaming(int camera_id);
1429  INTERFACE_API int sl_is_streaming_enabled(int camera_id);
1430 
1439  INTERFACE_API struct SL_StreamingParameters* sl_get_streaming_parameters(int camera_id);
1440 
1444 
1471  INTERFACE_API int sl_retrieve_encoded_stream_packet(int camera_id, enum SL_ENCODED_STREAM_SOURCE source, struct SL_EncodedStreamPacket* out_packet);
1472 
1483  INTERFACE_API void sl_get_encoded_streams_info(int camera_id, struct SL_EncodedStreamInfo out_infos[SL_ENCODED_STREAM_SOURCE_COUNT]);
1484 
1488 
1496  INTERFACE_API int sl_save_current_image(int camera_id, enum SL_VIEW view, const char* file_name);
1504  INTERFACE_API int sl_save_current_depth(int camera_id, enum SL_SIDE side, const char* file_name);
1512  INTERFACE_API int sl_save_current_point_cloud(int camera_id, enum SL_SIDE side, const char* file_name);
1513 
1514 
1515 
1516 #if WITH_OBJECT_DETECTION
1517 
1521 
1530  INTERFACE_API struct SL_AI_Model_status* sl_check_AI_model_status(enum SL_AI_MODELS model, int gpu_id);
1531 
1538  INTERFACE_API int sl_optimize_AI_model(enum SL_AI_MODELS model, int gpu_id);
1539 
1553  INTERFACE_API int sl_optimize_custom_AI_model(const char* custom_onnx_file, struct SL_Resolution custom_onnx_dynamic_input_shape, int gpu_id);
1554 
1576  INTERFACE_API int sl_enable_object_detection(int camera_id, struct SL_ObjectDetectionParameters* object_detection_parameters);
1577 
1588 
1589 
1598  INTERFACE_API void sl_disable_object_detection(int camera_id, unsigned int instance_id, bool force_disable_all_instances);
1599 
1600 
1610  INTERFACE_API int sl_set_object_detection_runtime_parameters(int camera_id, struct SL_ObjectDetectionRuntimeParameters object_detection_parameters, unsigned int instance_id);
1611 
1634  INTERFACE_API int sl_enable_body_tracking(int camera_id, struct SL_BodyTrackingParameters* body_tracking_parameters);
1635 
1645  INTERFACE_API struct SL_BodyTrackingParameters* sl_get_body_tracking_parameters(int camera_id);
1646 
1655  INTERFACE_API void sl_disable_body_tracking(int camera_id, unsigned int instance_id, bool force_disable_all_instances);
1656 
1665  INTERFACE_API int sl_set_body_tracking_runtime_parameters(int camera_id, struct SL_BodyTrackingRuntimeParameters body_tracking_parameters, unsigned int instance_id);
1666 
1672  INTERFACE_API int sl_generate_unique_id(char* uuid);
1673 
1674  INTERFACE_API int sl_generate_unique_id_str(char* uuid);
1675 
1685  INTERFACE_API int sl_ingest_custom_box_objects(int camera_id, int nb_objects, struct SL_CustomBoxObjectData* objects_in, unsigned int instance_id);
1686 
1702  INTERFACE_API int sl_ingest_custom_depth(int camera_id, void* map_ptr, enum SL_CUSTOM_DEPTH_FORMAT format, float scale, void* confidence_ptr, enum SL_CUSTOM_CONFIDENCE_CONVENTION confidence_convention, unsigned long long timestamp_ns);
1703 
1713  INTERFACE_API int sl_ingest_custom_mask_objects(int camera_id, int nb_objects, struct SL_CustomMaskObjectData* objects_in, unsigned int instance_id);
1714 
1723  INTERFACE_API int sl_retrieve_objects(int camera_id, struct SL_ObjectDetectionRuntimeParameters* object_detection_runtime_parameters, struct SL_Objects* objects, unsigned int instance_id);
1724 
1733  INTERFACE_API int sl_retrieve_custom_objects(int camera_id, struct SL_CustomObjectDetectionRuntimeParameters* object_detection_runtime_parameters, struct SL_Objects* objects, unsigned int instance_id);
1734 
1744  INTERFACE_API int sl_set_custom_object_detection_runtime_parameters(int camera_id, struct SL_CustomObjectDetectionRuntimeParameters custom_object_detection_parameters, unsigned int instance_id);
1745 
1754  INTERFACE_API int sl_retrieve_bodies(int camera_id, struct SL_BodyTrackingRuntimeParameters* body_tracking_runtime_parameters, struct SL_Bodies* bodies, unsigned int instance_id);
1755 
1762  INTERFACE_API int sl_update_objects_batch(int camera_id, int* nb_batches);
1763 
1772  INTERFACE_API int sl_get_objects_batch(int camera_id, int index, struct SL_ObjectsBatch* objs_batch);
1773 
1774  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,
1775  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],
1776  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],
1777  struct SL_Vector2 head_bounding_boxes_2d[MAX_TRAJECTORY_SIZE][4], struct SL_Vector3 head_bounding_boxes[MAX_TRAJECTORY_SIZE][8],
1778  struct SL_Vector3 head_positions[MAX_TRAJECTORY_SIZE]);
1779 
1780 #if 0
1787  INTERFACE_API int sl_update_bodies_batch(int camera_id, int* nb_batches);
1788 
1789 
1790 
1797  INTERFACE_API int sl_get_bodies_batch(int camera_id, int index, struct SL_BodiesBatch* bodies_batch);
1798 
1799 
1800 #endif
1801 #endif
1802 #ifdef __cplusplus
1803 }
1804 #endif
1805 
1809 
1810 #ifdef __cplusplus
1811 extern "C" {
1812 #endif
1813 
1819 
1824 
1825  /*
1826  * \brief adds a camera to the multi camera handler
1827  * \param [in] uuid : unique ID that is associated with the camera for easy access.
1828  * \param [in] params : communications parameters
1829  * \param [in] pose_translation : position of the camera
1830  * \param [in] pose_rotation : orientation of the camera
1831  * \return SL_FUSION_ERROR_CODE
1832  * */
1833  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_subscribe(struct SL_CameraIdentifier* uuid, struct SL_CommunicationParameters* params, struct SL_Vector3* pose_translation, struct SL_Quaternion* pose_rotation);
1834 
1844  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_image(void* mat, struct SL_CameraIdentifier* uuid, int width, int height);
1845 
1857  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_measure(void* mat, struct SL_CameraIdentifier* uuid, enum SL_MEASURE measure, int width, int height, enum SL_FUSION_REFERENCE_FRAME reference_frame);
1858 
1865 
1866  /*
1867  * \brief update the pose of the camera in the fusion coordinate space
1868  * \param [in] uuid : unique ID that is associated with the camera for easy access.
1869  * \param [in] pose_translation : new position of the camera
1870  * \param [in] pose_rotation : new orientation of the camera
1871  * \return SL_FUSION_ERROR_CODE
1872  * */
1873  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_update_pose(struct SL_CameraIdentifier* uuid, struct SL_Vector3* pose_translation, struct SL_Quaternion* pose_rotation);
1874 
1881  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_get_pose(struct SL_CameraIdentifier* uuid, struct SL_Vector3* pose_translation, struct SL_Quaternion* pose_rotation);
1882 
1883  /*
1884  * \brief Returns the state of a connected data sender.
1885  * \param [in] uuid : Identifier of the camera.
1886  * \return SL_SENDER_ERROR_CODE : State of the sender
1887  * */
1888  INTERFACE_API enum SL_SENDER_ERROR_CODE sl_fusion_get_sender_state(struct SL_CameraIdentifier* uuid);
1889 
1899  INTERFACE_API void sl_fusion_read_configuration_file(const char* json_config_filename, enum SL_COORDINATE_SYSTEM coord_system, enum SL_UNIT unit, struct SL_FusionConfiguration configs[MAX_FUSED_CAMERAS], int* nb_cameras);
1900 
1901 
1911  INTERFACE_API void sl_fusion_read_configuration(const char* fusion_configuration, enum SL_COORDINATE_SYSTEM coord_system, enum SL_UNIT unit, struct SL_FusionConfiguration configs[MAX_FUSED_CAMERAS], int* nb_cameras);
1912 
1916 
1922 
1926  INTERFACE_API void sl_fusion_disable_body_tracking();
1927 
1937 
1945 
1946 
1950 
1958 
1967  INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_position(struct SL_PoseData* pose, enum SL_REFERENCE_FRAME reference_frame,
1968  struct SL_CameraIdentifier* uuid, enum SL_POSITION_TYPE retrieve_type);
1969 
1970 
1976 
1981 
1985 
1992  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enu_to_geo(struct SL_ENU* in, struct SL_LatLng* out);
1993 
2000  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_geo_to_enu(struct SL_LatLng* in, struct SL_ENU* out);
2001 
2007  INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_ingest_gnss_data(struct SL_GNSSData* gnss_data, bool radian);
2008 
2015  INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_current_gnss_data(struct SL_GNSSData* data, bool radian);
2016 
2023  INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_geo_pose(struct SL_GeoPose* pose, bool radian);
2024 
2032  INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_geo_to_camera(struct SL_LatLng* in, struct SL_PoseData* out, bool radian);
2033 
2040  INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_camera_to_geo(struct SL_PoseData* in, struct SL_GeoPose* out, bool radian);
2041 
2046  INTERFACE_API unsigned long long sl_fusion_get_current_timestamp();
2047 
2055  INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_current_gnss_calibration_std(float* yaw_std, struct SL_Vector3* position_std);
2056 
2061  INTERFACE_API void sl_fusion_get_geo_tracking_calibration(struct SL_Vector3* translation, struct SL_Quaternion* rotation);
2062 
2066  INTERFACE_API void sl_fusion_close();
2067 
2068 #ifdef __cplusplus
2069 }
2070 #endif
2071 
2072 
2073 
2074 #ifdef __cplusplus
2075 extern "C" {
2076 #endif
2077 
2081 
2090  INTERFACE_API void* sl_mat_create_new(int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem);
2095  INTERFACE_API void* sl_mat_create_new_empty();
2101  INTERFACE_API bool sl_mat_is_init(void* ptr);
2107  INTERFACE_API void sl_mat_free(void* ptr, enum SL_MEM mem);
2113  INTERFACE_API void sl_mat_get_infos(void* ptr, char* buffer);
2114 
2115  // GET values
2125  INTERFACE_API int sl_mat_get_value_uchar(void* ptr, int col, int row, unsigned char* value, enum SL_MEM mem);
2135  INTERFACE_API int sl_mat_get_value_uchar2(void* ptr, int col, int row, struct SL_Uchar2* value, enum SL_MEM mem);
2145  INTERFACE_API int sl_mat_get_value_uchar3(void* ptr, int col, int row, struct SL_Uchar3* value, enum SL_MEM mem);
2155  INTERFACE_API int sl_mat_get_value_uchar4(void* ptr, int col, int row, struct SL_Uchar4* value, enum SL_MEM mem);
2156 
2166  INTERFACE_API int sl_mat_get_value_float(void* ptr, int col, int row, float* value, enum SL_MEM mem);
2176  INTERFACE_API int sl_mat_get_value_float2(void* ptr, int col, int row, struct SL_Vector2* value, enum SL_MEM mem);
2186  INTERFACE_API int sl_mat_get_value_float3(void* ptr, int col, int row, struct SL_Vector3* value, enum SL_MEM mem);
2196  INTERFACE_API int sl_mat_get_value_float4(void* ptr, int col, int row, struct SL_Vector4* value, enum SL_MEM mem);
2197 
2198  // SET VALUE
2208  INTERFACE_API int sl_mat_set_value_uchar(void* ptr, int col, int row, unsigned char value, enum SL_MEM mem);
2218  INTERFACE_API int sl_mat_set_value_uchar2(void* ptr, int col, int row, struct SL_Uchar2 value, enum SL_MEM mem);
2228  INTERFACE_API int sl_mat_set_value_uchar3(void* ptr, int col, int row, struct SL_Uchar3 value, enum SL_MEM mem);
2238  INTERFACE_API int sl_mat_set_value_uchar4(void* ptr, int col, int row, struct SL_Uchar4 value, enum SL_MEM mem);
2248  INTERFACE_API int sl_mat_set_value_float(void* ptr, int col, int row, float value, enum SL_MEM mem);
2258  INTERFACE_API int sl_mat_set_value_float2(void* ptr, int col, int row, struct SL_Vector2 value, enum SL_MEM mem);
2268  INTERFACE_API int sl_mat_set_value_float3(void* ptr, int col, int row, struct SL_Vector3 value, enum SL_MEM mem);
2278  INTERFACE_API int sl_mat_set_value_float4(void* ptr, int col, int row, struct SL_Vector4 value, enum SL_MEM mem);
2279 
2280  //SET TO
2288  INTERFACE_API int sl_mat_set_to_uchar(void* ptr, unsigned char value, enum SL_MEM mem);
2296  INTERFACE_API int sl_mat_set_to_uchar2(void* ptr, struct SL_Uchar2 value, enum SL_MEM mem);
2304  INTERFACE_API int sl_mat_set_to_uchar3(void* ptr, struct SL_Uchar3 value, enum SL_MEM mem);
2312  INTERFACE_API int sl_mat_set_to_uchar4(void* ptr, struct SL_Uchar4 value, enum SL_MEM mem);
2320  INTERFACE_API int sl_mat_set_to_float(void* ptr, float value, enum SL_MEM mem);
2328  INTERFACE_API int sl_mat_set_to_float2(void* ptr, struct SL_Vector2 value, enum SL_MEM mem);
2336  INTERFACE_API int sl_mat_set_to_float3(void* ptr, struct SL_Vector3 value, enum SL_MEM mem);
2344  INTERFACE_API int sl_mat_set_to_float4(void* ptr, struct SL_Vector4 value, enum SL_MEM mem);
2345 
2351  INTERFACE_API int sl_mat_update_cpu_from_gpu(void* ptr);
2357  INTERFACE_API int sl_mat_update_gpu_from_cpu(void* ptr);
2365  INTERFACE_API int sl_mat_copy_to(void* ptr, void* ptr_dest, enum SL_COPY_TYPE cpy_type);
2366 
2375  INTERFACE_API int sl_mat_read(void* ptr, const char* file_path);
2388  INTERFACE_API int sl_mat_write(void* ptr, const char* file_path, int compression_level);
2394  INTERFACE_API int sl_mat_get_width(void* ptr);
2400  INTERFACE_API int sl_mat_get_height(void* ptr);
2406  INTERFACE_API int sl_mat_get_channels(void* ptr);
2412  INTERFACE_API int sl_mat_get_memory_type(void* ptr);
2413 
2419  INTERFACE_API int sl_mat_get_data_type(void* ptr);
2425  INTERFACE_API int sl_mat_get_pixel_bytes(void* ptr);
2432  INTERFACE_API int sl_mat_get_step(void* ptr, enum SL_MEM mem);
2439  INTERFACE_API int sl_mat_get_step_bytes(void* ptr, enum SL_MEM mem);
2445  INTERFACE_API int sl_mat_get_width_bytes(void* ptr);
2450  INTERFACE_API bool sl_mat_is_memory_owner(void* ptr);
2456  INTERFACE_API struct SL_Resolution sl_mat_get_resolution(void* ptr);
2465  INTERFACE_API void sl_mat_alloc(void* ptr, int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem);
2474  INTERFACE_API int sl_mat_set_from(void* ptr, void* ptr_source, enum SL_COPY_TYPE copy_type);
2481  INTERFACE_API int* sl_mat_get_ptr(void* ptr, enum SL_MEM mem);
2487  INTERFACE_API int sl_mat_clone(void* ptr, void* ptr_source);
2488 
2494  INTERFACE_API void sl_mat_swap(void* ptr_1, void* ptr_2);
2495 
2500  INTERFACE_API int sl_mat_convert_color(void* ptr, enum SL_MEM memory, bool swap_RB_channels, void* stream);
2501 
2507  INTERFACE_API int sl_convert_color(void* mat1, void* mat2, bool swap_RB_channels, bool remove_alpha_channels, enum SL_MEM memory, void* stream);
2508 
2521  INTERFACE_API int sl_blob_from_image(void* image_in, void* tensor_out, struct SL_Resolution resolution_out,
2522  float scalefactor, struct SL_Vector3 mean, struct SL_Vector3 stddev, bool keep_aspect_ratio, bool swap_RB_channels,
2523  void* stream);
2524 
2539  INTERFACE_API int sl_blob_from_images(void** image_in, int nb_images, void* tensor_out, struct SL_Resolution resolution_out,
2540  float scalefactor, struct SL_Vector3 mean, struct SL_Vector3 stddev, bool keep_aspect_ratio, bool swap_RB_channels,
2541  void* stream);
2542 
2547  INTERFACE_API bool sl_is_camera_one(enum SL_MODEL m);
2548 
2554  INTERFACE_API bool sl_is_resolution_available(enum SL_RESOLUTION r, enum SL_MODEL m);
2555 
2562  INTERFACE_API bool sl_is_FPS_available(int fps, enum SL_RESOLUTION r, enum SL_MODEL m);
2563 
2569  INTERFACE_API bool sl_is_HDR_available(enum SL_RESOLUTION r, enum SL_MODEL m);
2570 
2571 
2572 #ifdef __cplusplus
2573 }
2574 #endif
2575 
2576 #endif
Structure containing AI model status.
Definition: types_c.h:2882
Structure containing the results of the body tracking module.
Definition: types_c.h:4016
Holds the options used to initialize the body tracking module of the Fusion.
Definition: types_c.h:4716
Holds the options used to change the behavior of the body tracking module at runtime.
Definition: types_c.h:4737
Structure containing a set of parameters for the body tracking module.
Definition: types_c.h:3251
Structure containing a set of runtime parameters for the body tracking module.
Definition: types_c.h:3351
Structure containing intrinsic and extrinsic parameters of the camera (translation and rotation).
Definition: types_c.h:2144
Used to identify a specific camera in the Fusion API.
Definition: types_c.h:4763
Structure containing information of a single camera (serial number, model, input type,...
Definition: types_c.h:2270
Definition: types_c.h:4535
Structure that store externally detected objects.
Definition: types_c.h:3512
Definition: types_c.h:3658
Structure containing a set of runtime parameters for the object detection module using your own model...
Definition: types_c.h:3226
Structure containing information about the properties of a camera.
Definition: types_c.h:1997
Represents a world position in ENU format.
Definition: types_c.h:5018
Describes one encoded video source exposed by the Camera.
Definition: types_c.h:711
Single encoded video packet retrieved from a Camera source.
Definition: types_c.h:694
Class containing the overall position fusion status.
Definition: types_c.h:4507
Useful struct to store the Fusion configuration, can be read from /write to a JSON file.
Definition: types_c.h:4544
Holds the metrics of the fusion process.
Definition: types_c.h:4815
Structure containing GNSS data to be used for positional tracking as prior.
Definition: types_c.h:4844
Holds Geo reference position.
Definition: types_c.h:4926
Definition: types_c.h:4272
Holds the options used to initialize the Fusion object.
Definition: types_c.h:4634
Structure containing the options used to initialize a camera.
Definition: types_c.h:1636
Represents a 2d landmark.
Definition: types_c.h:2419
Represents a 3d landmark.
Definition: types_c.h:2404
Represents a world position in LatLng format.
Definition: types_c.h:4903
Structure containing a set of parameters for the object detection module.
Definition: types_c.h:2894
Structure containing a set of runtime parameters for the object detection module.
Definition: types_c.h:3028
Structure containing batched data of a detected objects from the object detection module.
Definition: types_c.h:4058
Structure containing the results of the object detection module.
Definition: types_c.h:3817
Structure representing a plane defined by a point and a normal, or a plane equation.
Definition: types_c.h:243
enum UNITY_PLAN_TYPE type
Type of the plane defined by its orientation.
Definition: types_c.h:249
Structure containing a set of parameters for the plane detection functionality.
Definition: types_c.h:2475
Structure containing positional tracking data giving the position and orientation of the camera in 3D...
Definition: types_c.h:194
Holds the options used for initializing the positional tracking fusion module.
Definition: types_c.h:5092
Structure containing a set of parameters for the positional tracking module initialization.
Definition: types_c.h:2301
Lists the different status of positional tracking.
Definition: types_c.h:980
Structure representing a quaternion.
Definition: types_c.h:25
Structure containing the options used to record.
Definition: types_c.h:2540
Structure containing information about the status of the recording.
Definition: types_c.h:2495
Structure defining a 2D rectangle with top-left corner coordinates and width/height in pixels.
Definition: types_c.h:4207
Structure containing a set of parameters for the region of interest.
Definition: types_c.h:2446
Structure containing the width and height of an image.
Definition: types_c.h:1615
int width
Width of the image in pixels.
Definition: types_c.h:1619
int height
Height of the image in pixels.
Definition: types_c.h:1623
Structure containing parameters that defines the behavior of sl_grab().
Definition: types_c.h:1937
Structure containing data that can be stored in and retrieved from SVOs. That information will be ing...
Definition: types_c.h:2605
Structure containing information about all the sensors available in the current device.
Definition: types_c.h:2218
Structure containing all sensors data (except image sensors) to be used for positional tracking or en...
Definition: types_c.h:413
Structure containing a set of parameters for the spatial mapping module.
Definition: types_c.h:2758
Structure containing the options used to stream with the ZED SDK.
Definition: types_c.h:2633
Structure containing information about the properties of a streaming device.
Definition: types_c.h:2710
Structure representing an unsigned char 2-dimensional vector.
Definition: types_c.h:118
Structure representing an unsigned char 3-dimensional vector.
Definition: types_c.h:132
Structure representing an unsigned char 4-dimensional vector.
Definition: types_c.h:150
Structure representing a generic 2-dimensional vector.
Definition: types_c.h:35
Structure representing a generic 3-dimensional vector.
Definition: types_c.h:63
Structure representing a generic 4-dimensional vector.
Definition: types_c.h:81
Parameters controlling voxel decimation in sl_retrieve_voxel_measure.
Definition: types_c.h:788
SL_COORDINATE_SYSTEM
Lists available coordinates systems for positional tracking and 3D measures.
Definition: types_c.h:536
SL_ENCODED_STREAM_SOURCE
Lists the encoded video sources a Camera can expose to user code. A single Camera can produce up to t...
Definition: types_c.h:673
SL_SPATIAL_MAPPING_STATE
Lists the different states of spatial mapping.
Definition: types_c.h:1022
SL_MODULE
Definition: types_c.h:1594
SL_MESH_FILE_FORMAT
Lists available mesh file formats.
Definition: types_c.h:1050
SL_AI_MODELS
Lists available AI models.
Definition: types_c.h:1239
SL_TIMESTAMP_CLOCK
Selects the clock source used for all timestamps produced by the ZED SDK.
Definition: types_c.h:768
SL_STREAMING_CODEC
Lists the different encoding types for image streaming.
Definition: types_c.h:661
SL_MAT_TYPE
Lists available matrix formats.
Definition: types_c.h:1133
SL_RESOLUTION
Lists available resolutions.
Definition: types_c.h:491
SL_VIDEO_SETTINGS
Lists available camera settings for the camera (contrast, hue, saturation, gain, ....
Definition: types_c.h:724
SL_SVO_ENCODING_PRESET
Lists the available encoding presets for SVO recording.
Definition: types_c.h:756
SL_ERROR_CODE
Lists error codes in the ZED SDK.
Definition: types_c.h:440
SL_TIME_REFERENCE
Lists possible time references for timestamps or data.
Definition: types_c.h:652
SL_SIDE
Lists possible sides on which to get data from.
Definition: types_c.h:622
SL_REFERENCE_FRAME
Lists possible types of position matrix used to store camera path and pose.
Definition: types_c.h:644
SL_MESH_FILTER
Lists available mesh filtering intensities.
Definition: types_c.h:1041
SL_POSITIONAL_TRACKING_STATE
Lists the different states of positional tracking.
Definition: types_c.h:908
SL_MEM
Lists available memory type.
Definition: types_c.h:578
SL_GNSS_FUSION_STATUS
Class containing the current GNSS fusion status.
Definition: types_c.h:4476
SL_MODEL
Lists ZED camera model.
Definition: types_c.h:556
SL_SVO_COMPRESSION_MODE
Lists available compression modes for SVO recording.
Definition: types_c.h:1119
SL_VIEW
Lists available views.
Definition: types_c.h:844
SL_POSITION_TYPE
Lists the types of possible position outputs.
Definition: types_c.h:1607
SL_COPY_TYPE
Lists available copy operation on matrix.
Definition: types_c.h:1108
SL_CUSTOM_CONFIDENCE_CONVENTION
Lists the value convention of the confidence map optionally ingested with sl_ingest_custom_depth().
Definition: types_c.h:1090
SL_REGION_OF_INTEREST_AUTO_DETECTION_STATE
Lists the different states of region of interest auto detection.
Definition: types_c.h:1000
SL_UNIT
Lists available units for measures.
Definition: types_c.h:509
SL_FUSION_REFERENCE_FRAME
Enum to define the reference frame of the fusion SDK.
Definition: types_c.h:4498
SL_CUSTOM_DEPTH_FORMAT
Lists the content type of the map ingested with sl_ingest_custom_depth().
Definition: types_c.h:1082
SL_FUSION_ERROR_CODE
Lists the types of error that can be raised by the Fusion.
Definition: types_c.h:4328
SL_SENDER_ERROR_CODE
Lists the types of error that can be raised during the Fusion by senders.
Definition: types_c.h:4404
SL_MEASURE
Lists retrievable measures.
Definition: types_c.h:819
INTERFACE_API struct SL_CameraInformation * sl_get_camera_information(int camera_id, int res_width, int res_height)
Returns the SL_CameraInformation associated the camera.
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_current_gnss_calibration_std(float *yaw_std, struct SL_Vector3 *position_std)
Get the current calibration uncertainty defined during calibration process.
INTERFACE_API int sl_retrieve_bodies(int camera_id, struct SL_BodyTrackingRuntimeParameters *body_tracking_runtime_parameters, struct SL_Bodies *bodies, unsigned int instance_id)
Retrieve bodies detected by the body tracking module.
INTERFACE_API int sl_mat_get_value_uchar3(void *ptr, int col, int row, struct SL_Uchar3 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C3.
INTERFACE_API int sl_mat_get_value_uchar(void *ptr, int col, int row, unsigned char *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C1.
INTERFACE_API void * sl_mat_create_new(int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem)
Creates a matrix with the given resolution.
INTERFACE_API enum SL_ERROR_CODE sl_start_publishing(int camera_id, struct SL_CommunicationParameters *comm_params)
Set this camera as a data provider for the Fusion module.
INTERFACE_API struct SL_SpatialMappingParameters * sl_get_spatial_mapping_parameters(int camera_id)
Returns the SL_SpatialMappingParameters used.
INTERFACE_API int sl_mat_get_value_float3(void *ptr, int col, int row, struct SL_Vector3 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C3.
INTERFACE_API void sl_disable_object_detection(int camera_id, unsigned int instance_id, bool force_disable_all_instances)
Disables the Object Detection process.
INTERFACE_API void sl_mat_free(void *ptr, enum SL_MEM mem)
Frees the memory of the matrix.
INTERFACE_API int * sl_mat_get_ptr(void *ptr, enum SL_MEM mem)
Gets a pointer to the matrix.
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.
INTERFACE_API int sl_enable_recording_from_params(int camera_id, struct SL_RecordingParameters *recording_parameters)
Creates a file for recording the ZED's output, accepting the full SL_RecordingParameters structure.
INTERFACE_API bool sl_create_camera(int camera_id)
Creates a camera with resolution mode, fps and id for linux.
INTERFACE_API int sl_mat_set_value_float(void *ptr, int col, int row, float value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C1.
INTERFACE_API float sl_get_current_fps(int camera_id)
Returns the current FPS.
INTERFACE_API bool sl_is_camera_setting_supported(int camera_id, enum SL_VIDEO_SETTINGS setting)
Test if the video setting is supported by the camera.
INTERFACE_API int sl_mat_set_value_float4(void *ptr, int col, int row, struct SL_Vector4 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C4.
INTERFACE_API int sl_ingest_custom_box_objects(int camera_id, int nb_objects, struct SL_CustomBoxObjectData *objects_in, unsigned int instance_id)
Feed the 3D Object tracking function with your own 2D bounding boxes from your own detection algorith...
INTERFACE_API int sl_get_positional_tracking_landmarks_2d(int camera_id, struct SL_Landmark2D **landmarks2d, uint32_t *count)
Get the current positional tracking 2d landmarks. \Note the landmarks array has to be freed by the us...
INTERFACE_API struct SL_ObjectDetectionParameters * sl_get_object_detection_parameters(int camera_id)
Returns the SL_ObjectDetectionParameters used.
INTERFACE_API int sl_set_region_of_interest(int camera_id, void *roi_mask, bool module[SL_MODULE_LAST])
Defines a region of interest to focus on for all the SDK, discarding other parts.
INTERFACE_API void sl_fusion_read_configuration(const char *fusion_configuration, enum SL_COORDINATE_SYSTEM coord_system, enum SL_UNIT unit, struct SL_FusionConfiguration configs[MAX_FUSED_CAMERAS], int *nb_cameras)
Read a Configuration JSON string to configure a fusion process.
INTERFACE_API enum SL_ERROR_CODE sl_set_svo_position(int camera_id, int position)
Sets the playback cursor to the desired frame number in the SVO file.
INTERFACE_API int sl_retrieve_custom_objects(int camera_id, struct SL_CustomObjectDetectionRuntimeParameters *object_detection_runtime_parameters, struct SL_Objects *objects, unsigned int instance_id)
Retrieve objects detected by the custom object detection module.
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).
INTERFACE_API struct SL_PositionalTrackingStatus * sl_get_positional_tracking_status(int camera_id)
Return the current status of positional tracking module.
INTERFACE_API int sl_get_camera_firmware(int camera_id)
Gets the ZED camera current firmware version.
INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings(int camera_id, enum SL_VIDEO_SETTINGS mode, int value)
Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc....
INTERFACE_API int sl_mat_copy_to(void *ptr, void *ptr_dest, enum SL_COPY_TYPE cpy_type)
Copies data from this matrix to another matrix (deep copy).
INTERFACE_API int sl_mat_read(void *ptr, const char *file_path)
Reads an image from a file.
INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings_min_max(int c_id, enum SL_VIDEO_SETTINGS mode, int *minvalue, int *maxvalue)
Returns the current range of the requested camera setting (setting with range value).
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_camera_to_geo(struct SL_PoseData *in, struct SL_GeoPose *out, bool radian)
returns the current GeoPose
INTERFACE_API int sl_enable_body_tracking(int camera_id, struct SL_BodyTrackingParameters *body_tracking_parameters)
Initializes and starts the Deep Learning Body Tracking module.
INTERFACE_API int sl_mat_set_to_uchar(void *ptr, unsigned char value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_U8_C1 with the given value.
INTERFACE_API int sl_get_svo_data_size(int camera_id, char key[128], unsigned long long ts_begin, unsigned long long ts_end)
Gets the size of data available for a given key. Must be called before sl_retrieve_svo_data to initia...
INTERFACE_API int sl_mat_set_value_float3(void *ptr, int col, int row, struct SL_Vector3 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C3.
INTERFACE_API unsigned int sl_get_frame_dropped_count(int camera_id)
Gets the number of frames dropped since sl_grab() was called for the first time. Based on camera time...
INTERFACE_API int sl_retrieve_encoded_stream_packet(int camera_id, enum SL_ENCODED_STREAM_SOURCE source, struct SL_EncodedStreamPacket *out_packet)
Polls a single encoded H264/H265 packet from one of the Camera's encoded sources (receiving / sending...
INTERFACE_API bool sl_is_FPS_available(int fps, enum SL_RESOLUTION r, enum SL_MODEL m)
Check if a frame rate is available for a given resolution and camera model.
INTERFACE_API int sl_ingest_custom_mask_objects(int camera_id, int nb_objects, struct SL_CustomMaskObjectData *objects_in, unsigned int instance_id)
Feed the 3D Object tracking function with your own 2D bounding boxes with masks from your own detecti...
INTERFACE_API int sl_mat_get_value_float4(void *ptr, int col, int row, struct SL_Vector4 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C4.
INTERFACE_API struct SL_RecordingParameters * sl_get_recording_parameters(int camera_id)
Returns the SL_RecordingParameters used.
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 tra...
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).
INTERFACE_API struct SL_FusedPositionalTrackingStatus * sl_fusion_get_fused_positional_tracking_status()
Get the current status of fused position.
INTERFACE_API int sl_set_body_tracking_runtime_parameters(int camera_id, struct SL_BodyTrackingRuntimeParameters body_tracking_parameters, unsigned int instance_id)
Set the Body tracking module instance runtime parameters By default the Body tracking module will use...
INTERFACE_API int sl_get_objects_batch(int camera_id, int index, struct SL_ObjectsBatch *objs_batch)
Gets a batch of detected objects.
INTERFACE_API void sl_mat_get_infos(void *ptr, char *buffer)
Returns the information about the matrix into a string.
INTERFACE_API struct SL_AI_Model_status * sl_check_AI_model_status(enum SL_AI_MODELS model, int gpu_id)
INTERFACE_API int sl_retrieve_image(int camera_id, void *image_ptr, enum SL_VIEW type, enum SL_MEM mem, int width, int height, void *custream)
Retrieves an image texture from the ZED SDK in a human-viewable format.
INTERFACE_API float sl_get_max_system_clock_step_ms()
Returns the current maximum system clock step limit in milliseconds.
INTERFACE_API unsigned long long sl_fusion_get_current_timestamp()
returns the current timestamp
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 envir...
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 trac...
INTERFACE_API int sl_update_fused_point_cloud(int camera_id, int *nb_vertices_tot)
Updates the fused point cloud (if spatial map type was SL_SPATIAL_MAP_TYPE_FUSED_POINT_CLOUD).
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_process()
process the fusion.
INTERFACE_API int sl_get_camera_model(int camera_id)
Gets the ZED Camera model (see SL_MODEL).
INTERFACE_API void sl_disable_streaming(int camera_id)
Disables the streaming initiated by sl_enable_streaming().
INTERFACE_API bool sl_is_camera_one(enum SL_MODEL m)
Check if the camera is a ZED One (Monocular) or ZED (Stereo)
INTERFACE_API void sl_pause_recording(int camera_id, bool status)
Pauses or resumes the recording.
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.
INTERFACE_API int sl_retrieve_objects(int camera_id, struct SL_ObjectDetectionRuntimeParameters *object_detection_runtime_parameters, struct SL_Objects *objects, unsigned int instance_id)
Retrieve objects detected by the object detection module.
INTERFACE_API int sl_mat_get_value_uchar4(void *ptr, int col, int row, struct SL_Uchar4 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C4.
INTERFACE_API char * sl_get_sdk_version()
Returns the version of the currently installed ZED SDK.
INTERFACE_API void sl_disable_positional_tracking(int camera_id, const char *area_file_path)
Disables the positional tracking.
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.
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.
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.
INTERFACE_API bool sl_mat_is_memory_owner(void *ptr)
Returns whether the matrix is the owner of the memory it accesses.
INTERFACE_API int sl_get_imu_orientation(int camera_id, struct SL_Quaternion *quat, enum SL_TIME_REFERENCE time_reference)
Gets the rotation given by the IMU.
INTERFACE_API int sl_get_svo_position(int camera_id)
Returns the current playback position in the SVO file.
INTERFACE_API enum SL_TIMESTAMP_CLOCK sl_get_timestamp_clock()
Returns the active clock source used for timestamps.
INTERFACE_API int sl_get_svo_data_keys_size(int camera_id)
Gets the number of external channels that can be retrieved from the SVO file.
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.
INTERFACE_API int sl_mat_get_width_bytes(void *ptr)
Returns the size of a row in bytes.
INTERFACE_API int sl_mat_set_to_uchar4(void *ptr, struct SL_Uchar4 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_U8_C4 with the given value.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_init(struct SL_InitFusionParameters *params)
FusionHandler initialisation. Initializes memory/generic datas.
INTERFACE_API int sl_ingest_custom_depth(int camera_id, void *map_ptr, enum SL_CUSTOM_DEPTH_FORMAT format, float scale, void *confidence_ptr, enum SL_CUSTOM_CONFIDENCE_CONVENTION confidence_convention, unsigned long long timestamp_ns)
Feed the depth pipeline with your own externally computed disparity or depth map (requires SL_DEPTH_M...
INTERFACE_API struct SL_CalibrationParameters * sl_get_calibration_parameters(int camera_id, bool raw_params)
Gets the Calibration Parameters.
INTERFACE_API void sl_mat_alloc(void *ptr, int width, int height, enum SL_MAT_TYPE type, enum SL_MEM mem)
Allocates memory for the matrix.
INTERFACE_API void sl_unload_all_instances()
Forces unload of all instances.
INTERFACE_API int sl_start_region_of_interest_auto_detection(int camera_id, struct SL_RegionOfInterestParameters *roi_param)
Start the auto detection of a region of interest to focus on for all the SDK, discarding other parts....
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...
INTERFACE_API int sl_mat_get_value_float(void *ptr, int col, int row, float *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C1.
INTERFACE_API enum SL_ERROR_CODE sl_stop_publishing(int camera_id)
Set this camera as normal camera(without data providing). Stop to send camera data to fusion.
INTERFACE_API void sl_request_mesh_async(int camera_id)
Starts the spatial map generation process in a non-blocking thread from the spatial mapping process.
INTERFACE_API int sl_is_streaming_enabled(int camera_id)
Tells if the streaming is running.
INTERFACE_API void sl_disable_body_tracking(int camera_id, unsigned int instance_id, bool force_disable_all_instances)
Disables the body tracking process.
INTERFACE_API bool sl_is_resolution_available(enum SL_RESOLUTION r, enum SL_MODEL m)
Check if a resolution is available for a given camera model.
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.
INTERFACE_API int sl_get_svo_number_of_frames(int camera_id)
Returns the number of frames in the SVO file.
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.
INTERFACE_API void sl_disable_spatial_mapping(int camera_id)
Disables the spatial mapping process.
INTERFACE_API void sl_disable_recording(int camera_id)
Disables the recording initiated by sl_enable_recording() and closes the generated file.
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.
INTERFACE_API int sl_mat_write(void *ptr, const char *file_path, int compression_level)
Writes the Mat into a file as an image. Only works if Mat has access to MEM_CPU.
INTERFACE_API void sl_set_max_system_clock_step_ms(float limit_ms)
Sets an upper bound on the step size of system-clock adjustments applied to SDK timestamps.
INTERFACE_API int sl_mat_get_channels(void *ptr)
Returns the number of values stored in one pixel.
INTERFACE_API unsigned long long sl_get_timestamp(int camera_id, enum SL_TIME_REFERENCE time_reference)
Get a timestamp at the given time reference.
INTERFACE_API struct SL_PositionalTrackingParameters * sl_get_positional_tracking_parameters(int camera_id)
Returns the SL_PositionalTrackingParameters used.
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.
INTERFACE_API void sl_get_encoded_streams_info(int camera_id, struct SL_EncodedStreamInfo out_infos[SL_ENCODED_STREAM_SOURCE_COUNT])
Returns one SL_EncodedStreamInfo entry per encoded source (always SL_ENCODED_STREAM_SOURCE_COUNT entr...
INTERFACE_API struct SL_PlaneData * sl_find_plane_at_hit(int camera_id, struct SL_Vector2 pixel, struct SL_PlaneDetectionParameters *params, bool thres)
Checks the plane at the given left image coordinates.
INTERFACE_API int sl_mat_convert_color(void *ptr, enum SL_MEM memory, bool swap_RB_channels, void *stream)
Convert the color channels of the Mat (RGB<->BGR or RGBA<->BGRA) This methods works only on 8U_C4 or ...
INTERFACE_API int sl_set_custom_object_detection_runtime_parameters(int camera_id, struct SL_CustomObjectDetectionRuntimeParameters custom_object_detection_parameters, unsigned int instance_id)
Set the Object detection module instance runtime parameters when using the Custom model (OBJECT_DETEC...
INTERFACE_API int sl_get_svo_position_at_timestamp(int camera_id, unsigned long long timestamp)
Retrieves the frame index within the SVO file corresponding to the provided timestamp.
INTERFACE_API void sl_free(void *ptr)
Frees a buffer that the SDK allocated on the caller's behalf. Use it on every pointer returned by a f...
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_image(void *mat, struct SL_CameraIdentifier *uuid, int width, int height)
Returns the current sl_VIEW_LEFT of the specified camera, the data is synchronized.
INTERFACE_API int sl_get_current_min_max_depth(int camera_id, float *min, float *max)
Gets the current range of perceived depth.
INTERFACE_API int sl_open_camera_from_serial_number(int camera_id, struct SL_InitParameters *init_parameters, const unsigned int serial_number, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
Opens the ZED camera from the provided SL_InitParameters using its serial number.
INTERFACE_API struct SL_RuntimeParameters * sl_get_runtime_parameters(int camera_id)
Returns the SL_RuntimeParameters used.
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, unsigned char encryption_key[256], enum SL_SVO_ENCODING_PRESET encoding_preset)
Creates a file for recording the ZED's output into a .SVO or .AVI video.
INTERFACE_API int sl_mat_get_memory_type(void *ptr)
Gets the type of memory (CPU and/or GPU).
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.
INTERFACE_API void sl_set_timestamp_clock(enum SL_TIMESTAMP_CLOCK clock)
Sets the clock source used for all timestamps produced by the ZED SDK.
INTERFACE_API bool sl_is_opened(int camera_id)
Reports if the camera has been successfully opened.
INTERFACE_API int sl_retrieve_fused_point_cloud(int camera_id, float *vertices)
Retrieves all points of the fused point cloud.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_bodies(struct SL_Bodies *bodies, struct SL_BodyTrackingFusionRuntimeParameters *rt, struct SL_CameraIdentifier uuid, enum SL_FUSION_REFERENCE_FRAME reference_frame)
retrieves a list of bodies (in SL_Bodies class type) seen by all cameras and merged as if it was seen...
INTERFACE_API enum SL_ERROR_CODE sl_set_roi_for_aec_agc(int camera_id, enum SL_SIDE side, struct SL_Rect *roi, bool reset)
Sets the region of interest for automatic exposure/gain computation.
INTERFACE_API struct SL_InitParameters * sl_get_init_parameters(int camera_id)
Returns the SL_InitParameters used.
INTERFACE_API int sl_generate_unique_id(char *uuid)
Generate a UUID like unique id to help identify and track AI detections.
INTERFACE_API int sl_get_sensors_data_batch(int camera_id, struct SL_SensorsData **data)
Retrieves all SL_SensorsData associated to most recent grabbed frame in the specified COORDINATE_SYST...
INTERFACE_API int sl_mat_clone(void *ptr, void *ptr_source)
Duplicates a matrix by copying all its data into a new one (deep copy).
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.
INTERFACE_API int sl_get_sensors_data(int camera_id, struct SL_SensorsData *data, enum SL_TIME_REFERENCE time_reference)
Gets SL_SensorsData (IMU, magnetometer, barometer) at a specific time reference.
INTERFACE_API struct SL_HealthStatus * sl_get_health_status(int camera_id)
Gets the current status of the camera.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_unsubscribe(struct SL_CameraIdentifier *uuid)
Remove the specified camera from data provider.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_get_process_metrics(struct SL_FusionMetrics *metrics)
get the stats of a given camera in the Fusion API side It can be the received FPS,...
INTERFACE_API int sl_mat_set_to_float(void *ptr, float value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_F32_C1 with the given value.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_body_tracking(struct SL_BodyTrackingFusionParameters *params)
enables Object detection fusion module
INTERFACE_API int sl_retrieve_voxel_measure(int camera_id, void *measure_ptr, enum SL_MEASURE type, enum SL_MEM mem, struct SL_VoxelMeasureParameters *params, void *stream)
Retrieves a voxel-decimated point cloud from the ZED SDK.
INTERFACE_API int sl_mat_set_to_uchar2(void *ptr, struct SL_Uchar2 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_U8_C2 with the given value.
INTERFACE_API float sl_get_camera_fps(int camera_id)
Returns the camera FPS.
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).
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_geo_to_enu(struct SL_LatLng *in, struct SL_ENU *out)
Convert a global world coordinate to a ENU position expressed inside the Fusion coordinate system.
INTERFACE_API int sl_blob_from_images(void **image_in, int nb_images, void *tensor_out, struct SL_Resolution resolution_out, float scalefactor, struct SL_Vector3 mean, struct SL_Vector3 stddev, bool keep_aspect_ratio, bool swap_RB_channels, void *stream)
Convert a list of images into a GPU Tensor in planar channel configuration (NCHW),...
INTERFACE_API int sl_convert_color(void *mat1, void *mat2, bool swap_RB_channels, bool remove_alpha_channels, enum SL_MEM memory, void *stream)
Convert the color channels of the Mat into another Mat This methods works only on 8U_C4 if remove_alp...
INTERFACE_API int sl_mat_get_step(void *ptr, enum SL_MEM mem)
Returns the memory step in number of elements (size in one pixel row).
INTERFACE_API int sl_convert_image(void *image_in_ptr, void *image_signed_ptr, void *stream)
Convert Image format from Unsigned char to Signed char, designed for Unreal Engine pipeline,...
INTERFACE_API int sl_mat_update_cpu_from_gpu(void *ptr)
Copies data from the GPU to the CPU, if possible.
INTERFACE_API void sl_fusion_close()
Close Multi Camera instance.
INTERFACE_API void sl_pause_svo_reading(int camera_id, bool status)
Pauses or resumes SVO reading.
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_geo_to_camera(struct SL_LatLng *in, struct SL_PoseData *out, bool radian)
Convert latitude / longitude into position in sl::Fusion coordinate system.
INTERFACE_API void sl_close_camera(int camera_id)
Close an opened camera and disable the textures.
INTERFACE_API struct SL_StreamingParameters * sl_get_streaming_parameters(int camera_id)
Returns the SL_StreamingParameters used.
INTERFACE_API struct SL_BodyTrackingParameters * sl_get_body_tracking_parameters(int camera_id)
Returns the SL_BodyTrackingParameters used.
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.
INTERFACE_API void sl_mat_swap(void *ptr_1, void *ptr_2)
Swaps the content of the provided matrix (only swaps the pointers, no data copy).
INTERFACE_API int sl_mat_get_width(void *ptr)
Returns the width of the matrix.
INTERFACE_API int sl_mat_get_data_type(void *ptr)
Returns the format of the matrix.
INTERFACE_API int sl_open_camera(int camera_id, struct SL_InitParameters *init_parameters, const unsigned int serial_number, const char *path_svo, const char *ip, int stream_port, int bus_port, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
Opens the ZED camera from the provided SL_InitParameters.
INTERFACE_API int sl_mat_set_value_uchar2(void *ptr, int col, int row, struct SL_Uchar2 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C2.
INTERFACE_API enum SL_ERROR_CODE sl_ingest_data_into_svo(int camera_id, struct SL_SVOData *data)
Ingests SL_SVOData in a SVO file.
INTERFACE_API void * sl_get_camera_handle(int camera_id)
Returns an opaque pointer to the ZEDController instance for the given camera.
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.
INTERFACE_API int sl_blob_from_image(void *image_in, void *tensor_out, struct SL_Resolution resolution_out, float scalefactor, struct SL_Vector3 mean, struct SL_Vector3 stddev, bool keep_aspect_ratio, bool swap_RB_channels, void *stream)
Convert an image into a GPU Tensor in planar channel configuration (NCHW), ready to use for deep lear...
INTERFACE_API int sl_mat_set_from(void *ptr, void *ptr_source, enum SL_COPY_TYPE copy_type)
Copies data from another matrix into this one (deep copy).
INTERFACE_API bool sl_mat_is_init(void *ptr)
Returns whether the matrix is initialized or not.
INTERFACE_API void sl_fusion_disable_body_tracking()
Disable the object detection module.
INTERFACE_API enum SL_GNSS_FUSION_STATUS sl_fusion_get_geo_pose(struct SL_GeoPose *pose, bool radian)
returns the current GeoPose
INTERFACE_API int sl_reboot(int sn, bool full_reboot)
Performs a hardware reset of the ZED 2 and the ZED 2i.
INTERFACE_API struct SL_PlaneData * sl_find_floor_plane(int camera_id, struct SL_Quaternion *reset_quaternion, struct SL_Vector3 *reset_translation, struct SL_Quaternion prior_rotation, struct SL_Vector3 prior_translation)
Detect the floor plane of the scene.
INTERFACE_API int sl_mat_set_to_float3(void *ptr, struct SL_Vector3 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_F32_C3 with the given value.
INTERFACE_API int sl_open_camera_from_stream(int camera_id, struct SL_InitParameters *init_parameters, const char *ip, int stream_port, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
Opens the ZED camera from the provided SL_InitParameters using its IP and stream port.
INTERFACE_API int sl_update_objects_batch(int camera_id, int *nb_batches)
Updates the internal batch of detected objects.
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).
INTERFACE_API int sl_get_area_export_state(int camera_id)
Returns the state of the spatial memory export process.
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.
INTERFACE_API bool sl_is_positional_tracking_enabled(int camera_id)
Tells if the tracking module is enabled.
INTERFACE_API struct SL_RecordingStatus * sl_get_recording_status(int camera_id)
Get the recording information.
int INTERFACE_API sl_get_height(int camera_id)
Returns the height of the current image.
INTERFACE_API int sl_get_sensors_firmware(int camera_id)
Gets the sensor module current firmware version.
INTERFACE_API bool sl_is_HDR_available(enum SL_RESOLUTION r, enum SL_MODEL m)
Check if a resolution for a given camera model is available for HDR.
INTERFACE_API int sl_retrieve_whole_mesh(int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr)
Retrieves the full mesh. Call update_mesh before calling this. Vertex and triangles arrays must be at...
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.
INTERFACE_API int sl_mat_set_value_uchar4(void *ptr, int col, int row, struct SL_Uchar4 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C4.
INTERFACE_API int sl_open_camera_from_svo_file(int camera_id, struct SL_InitParameters *init_parameters, const char *path_svo, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
Opens the ZED camera from the provided SL_InitParameters using an SVO file.
INTERFACE_API int sl_retrieve_measure(int camera_id, void *measure_ptr, enum SL_MEASURE type, enum SL_MEM mem, int width, int height, void *custream)
Retrieves a measure texture from the ZED SDK.
INTERFACE_API int sl_enable_object_detection(int camera_id, struct SL_ObjectDetectionParameters *object_detection_parameters)
Initializes and starts object detection module.
INTERFACE_API int sl_mat_set_to_float2(void *ptr, struct SL_Vector2 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_F32_C2 with the given value.
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).
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.
INTERFACE_API int sl_mat_set_value_uchar3(void *ptr, int col, int row, struct SL_Uchar3 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C3.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enu_to_geo(struct SL_ENU *in, struct SL_LatLng *out)
Convert a ENU position expressed inside the Fusion coordinate system to a global world coordinate.
INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_current_gnss_data(struct SL_GNSSData *data, bool radian)
returns the current GNSS data
INTERFACE_API int sl_get_position_data(int camera_id, struct SL_PoseData *poseData, enum SL_REFERENCE_FRAME reference_frame)
Gets the current position of the camera and state of the tracking, filling a SL_PoseData struck usefu...
INTERFACE_API void sl_unload_instance(int camera_id)
Forces unload of one instance.
INTERFACE_API struct SL_Resolution * sl_get_retrieve_measure_resolution(int camera_id, struct SL_Resolution *res)
Returns the resolution at which sl_retrieve_measure() outputs, for a requested resolution.
INTERFACE_API struct SL_Resolution sl_mat_get_resolution(void *ptr)
Returns the resolution (width and height) of the matrix.
INTERFACE_API int sl_mat_update_gpu_from_cpu(void *ptr)
Copies data from the CPU to the GPU, if possible.
INTERFACE_API struct SL_SensorsConfiguration * sl_get_sensors_configuration(int camera_id)
Gets the Sensors configuration.
INTERFACE_API int sl_mat_set_to_uchar3(void *ptr, struct SL_Uchar3 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_U8_C3 with the given value.
INTERFACE_API int sl_extract_whole_spatial_map(int camera_id)
Extracts the current spatial map from the spatial mapping process.
INTERFACE_API void sl_fusion_get_geo_tracking_calibration(struct SL_Vector3 *translation, struct SL_Quaternion *rotation)
Get the calibration found between VIO and GNSS.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_retrieve_measure(void *mat, struct SL_CameraIdentifier *uuid, enum SL_MEASURE measure, int width, int height, enum SL_FUSION_REFERENCE_FRAME reference_frame)
Returns the current measure of the specified camera, the data is synchronized.
INTERFACE_API enum SL_ERROR_CODE sl_set_camera_settings_min_max(int camera_id, enum SL_VIDEO_SETTINGS mode, int min, int max)
Sets the range values of the requested camera setting (gain, brightness, hue, exposure,...
INTERFACE_API int sl_open_camera_from_camera_id(int camera_id, struct SL_InitParameters *init_parameters, const char *output_file, const char *opt_settings_path, const char *opencv_calib_path)
Opens the ZED camera from the provided SL_InitParameters using its camera ID.
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.
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.
INTERFACE_API int sl_mat_get_pixel_bytes(void *ptr)
Returns the size of one pixel in bytes.
INTERFACE_API int sl_mat_set_value_uchar(void *ptr, int col, int row, unsigned char value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_U8_C1.
INTERFACE_API int sl_mat_get_value_uchar2(void *ptr, int col, int row, struct SL_Uchar2 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_U8_C2.
INTERFACE_API void sl_fusion_disable_positional_tracking()
disable the positional tracking
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).
INTERFACE_API enum SL_ERROR_CODE sl_retrieve_svo_data(int camera_id, char *key, int nb_data, struct SL_SVOData **data, unsigned long long ts_begin, unsigned long long ts_end)
Retrieves SVOData from an SVO file. The user is reponsible for correctly allocating the size of the d...
INTERFACE_API struct SL_Resolution * sl_get_retrieve_image_resolution(int camera_id, struct SL_Resolution *res)
Returns the resolution at which sl_retrieve_image() outputs, for a requested resolution.
INTERFACE_API int sl_get_mesh_request_status_async(int camera_id)
Returns the spatial map generation status.
INTERFACE_API int sl_retrieve_chunks(int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr, const int max_submesh)
Retrieves all chunks of the full mesh.
INTERFACE_API CUcontext sl_get_cuda_context(int camera_id)
Gets the Camera-created CUDA context for sharing it with other CUDA-capable libraries.
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.
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 t...
INTERFACE_API int sl_get_region_of_interest(int camera_id, void *roi_mask, int width, int height, enum SL_MODULE module)
Get the previously set or computed region of interest.
INTERFACE_API int sl_mat_set_to_float4(void *ptr, struct SL_Vector4 value, enum SL_MEM mem)
Fills the matrix of type SL_MAT_TYPE_F32_C4 with the given value.
INTERFACE_API int sl_get_zed_serial(int camera_id)
Gets the ZED Serial Number.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_get_pose(struct SL_CameraIdentifier *uuid, struct SL_Vector3 *pose_translation, struct SL_Quaternion *pose_rotation)
Get the specified camera position inside fusion WORLD.
INTERFACE_API void sl_pause_spatial_mapping(int camera_id, bool status)
INTERFACE_API void sl_fusion_read_configuration_file(const char *json_config_filename, enum SL_COORDINATE_SYSTEM coord_system, enum SL_UNIT unit, struct SL_FusionConfiguration configs[MAX_FUSED_CAMERAS], int *nb_cameras)
Read a Configuration JSON file to configure a fusion process.
INTERFACE_API enum SL_POSITIONAL_TRACKING_STATE sl_fusion_get_position(struct SL_PoseData *pose, enum SL_REFERENCE_FRAME reference_frame, struct SL_CameraIdentifier *uuid, enum SL_POSITION_TYPE retrieve_type)
Get the Fused Position of the camera system.
INTERFACE_API int sl_get_input_type(int camera_id)
Gets the input type (see SL_INPUT_TYPE).
INTERFACE_API int sl_mat_get_step_bytes(void *ptr, enum SL_MEM mem)
Returns the memory step in bytes (size of one pixel row).
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.
INTERFACE_API unsigned long long sl_get_current_timestamp(int camera_id)
Get the current timestamp at the time the function is called.
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.
INTERFACE_API enum SL_REGION_OF_INTEREST_AUTO_DETECTION_STATE sl_get_region_of_interest_auto_detection_status(int camera_id)
Return the status of the automatic Region of Interest Detection The automatic Region of Interest Dete...
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_enable_positional_tracking(struct SL_PositionalTrackingFusionParameters *params)
enable positional tracking fusion.
INTERFACE_API int sl_retrieve_mesh(int camera_id, float *vertices, int *triangles, unsigned char *colors, float *uvs, unsigned char *texture_ptr, const int max_submeshes)
Retrieves all chunks of the current mesh.
INTERFACE_API int sl_mat_get_height(void *ptr)
Returns the height of the matrix.
INTERFACE_API int sl_set_object_detection_runtime_parameters(int camera_id, struct SL_ObjectDetectionRuntimeParameters object_detection_parameters, unsigned int instance_id)
Set the Object detection module instance runtime parameters By default the object detection module wi...
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...
INTERFACE_API enum SL_ERROR_CODE sl_get_camera_settings(int c_id, enum SL_VIDEO_SETTINGS mode, int *value)
Returns the current value of the requested camera setting (gain, brightness, hue, exposure,...
INTERFACE_API int sl_grab(int camera_id, struct SL_RuntimeParameters *runtime)
Grabs the latest images from the camera.
INTERFACE_API int sl_mat_get_value_float2(void *ptr, int col, int row, struct SL_Vector2 *value, enum SL_MEM mem)
Returns the value of a specific point in the matrix of type SL_MAT_TYPE_F32_C2.
INTERFACE_API int sl_enable_spatial_mapping(int camera_id, struct SL_SpatialMappingParameters *mapping_param)
Initializes and starts the spatial mapping processes.
INTERFACE_API int sl_optimize_custom_AI_model(const char *custom_onnx_file, struct SL_Resolution custom_onnx_dynamic_input_shape, int gpu_id)
Optimize a custom object detection ONNX model ahead of time, so that sl_enable_object_detection() can...
INTERFACE_API enum SL_ERROR_CODE sl_get_roi_for_aec_agc(int id, enum SL_SIDE side, struct SL_Rect *roi)
Gets the region of interest for automatic exposure/gain computation.
INTERFACE_API void sl_get_camera_imu_transform(int camera_id, struct SL_Vector3 *translation, struct SL_Quaternion *rotation)
Gets the IMU to the left camera transform matrix.
INTERFACE_API int sl_set_imu_prior_orientation(int camera_id, struct SL_Quaternion rotation)
Set an optional IMU orientation hint that will be used to assist the tracking during the next sl_grab...
INTERFACE_API int sl_mat_set_value_float2(void *ptr, int col, int row, struct SL_Vector2 value, enum SL_MEM mem)
Sets a value to a specific point in the matrix of type SL_MAT_TYPE_F32_C2.
INTERFACE_API void sl_update_self_calibration(int camera_id)
Performs a new self calibration process.
INTERFACE_API enum SL_FUSION_ERROR_CODE sl_fusion_ingest_gnss_data(struct SL_GNSSData *gnss_data, bool radian)
Add GNSS that will be used by fusion for computing fused pose.
INTERFACE_API void sl_get_svo_data_keys(int camera_id, int nb_keys, char **keys)
Gets the external channels that can be retrieved from the SVO file. The user is reponsible for correc...
INTERFACE_API int sl_get_number_zed_connected()
Gets the number of zed connected.
INTERFACE_API int sl_get_positional_tracking_landmarks(int camera_id, struct SL_Landmark **landmarks, uint32_t *count)
Get the current positional tracking landmarks. \Note the landmarks array has to be freed by the user.
int INTERFACE_API sl_get_width(int camera_id)
Returns the width of the current image.
INTERFACE_API int sl_get_sensors_data_batch_count(int camera_id, int *count)
Retrieves the size of the imu batch array. Needs to be called before sl_get_sensors_data_batch().
INTERFACE_API enum SL_SPATIAL_MAPPING_STATE sl_get_spatial_mapping_state(int camera_id)
Returns the current spatial mapping state.
INTERFACE_API void * sl_mat_create_new_empty()
Creates an empty matrix.
INTERFACE_API int sl_read(int camera_id)
Read the latest images and IMU from the camera and rectify the images.