21
21
# File containing the Cython declarations to use the sl functions.
22
22
23
23
from libcpp.string cimport string
24
- from libc.stdint cimport uint8_t
24
+ from libc.stdint cimport uint8_t, uint64_t
25
25
from libcpp cimport bool
26
26
from libcpp.pair cimport pair
27
27
from libcpp.vector cimport vector
28
28
from libc.string cimport const_char
29
29
from libcpp.map cimport map
30
30
from libcpp.unordered_set cimport unordered_set
31
31
from libcpp.unordered_map cimport unordered_map
32
+ from libcpp.map cimport map
33
+ from libcpp.vector cimport vector
34
+
32
35
33
36
cdef extern from " <array>" namespace " std" nogil:
34
37
cdef cppclass array6 " std::array<float, 6>" :
@@ -118,9 +121,13 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
118
121
ZED2i ' sl::MODEL::ZED2i' ,
119
122
ZED_X ' sl::MODEL::ZED_X' ,
120
123
ZED_XM ' sl::MODEL::ZED_XM' ,
124
+ ZED_X_HDR ' sl::MODEL::ZED_X_HDR' ,
125
+ ZED_X_HDR_MINI ' sl::MODEL::ZED_X_HDR_MINI' ,
126
+ ZED_X_HDR_MAX ' sl::MODEL::ZED_X_HDR_MAX' ,
121
127
VIRTUAL_ZED_X ' sl::MODEL::VIRTUAL_ZED_X' ,
122
128
ZED_XONE_GS ' sl::MODEL::ZED_XONE_GS' ,
123
129
ZED_XONE_UHD ' sl::MODEL::ZED_XONE_UHD' ,
130
+ ZED_XONE_HDR ' sl::MODEL::ZED_XONE_HDR' ,
124
131
MODEL_LAST ' sl::MODEL::LAST'
125
132
126
133
String toString(MODEL o)
@@ -145,9 +152,16 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
145
152
CAMERA_STATE camera_state
146
153
int id
147
154
String path
155
+ int i2c_port
148
156
MODEL camera_model
149
157
unsigned int serial_number
158
+ unsigned char identifier[]
159
+ String camera_badge
160
+ String camera_sensor_model
161
+ String camera_name
150
162
INPUT_TYPE input_type
163
+ unsigned char sensor_address_left
164
+ unsigned char sensor_address_right
151
165
152
166
String toString(DeviceProperties o)
153
167
@@ -269,6 +283,7 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
269
283
HD2K ' sl::RESOLUTION::HD2K'
270
284
HD1080 ' sl::RESOLUTION::HD1080'
271
285
HD1200 ' sl::RESOLUTION::HD1200'
286
+ HD1536 ' sl::RESOLUTION::HD1536'
272
287
HD720 ' sl::RESOLUTION::HD720'
273
288
SVGA ' sl::RESOLUTION::SVGA'
274
289
VGA ' sl::RESOLUTION::VGA'
@@ -308,6 +323,7 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
308
323
PERFORMANCE ' sl::DEPTH_MODE::PERFORMANCE'
309
324
QUALITY ' sl::DEPTH_MODE::QUALITY'
310
325
ULTRA ' sl::DEPTH_MODE::ULTRA'
326
+ NEURAL_LIGHT ' sl::DEPTH_MODE::NEURAL_LIGHT'
311
327
NEURAL ' sl::DEPTH_MODE::NEURAL'
312
328
NEURAL_PLUS ' sl::DEPTH_MODE::NEURAL_PLUS'
313
329
DEPTH_MODE_LAST ' sl::DEPTH_MODE::LAST'
@@ -454,6 +470,7 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
454
470
ctypedef enum POSITIONAL_TRACKING_MODE ' sl::POSITIONAL_TRACKING_MODE' :
455
471
GEN_1 ' sl::POSITIONAL_TRACKING_MODE::GEN_1'
456
472
GEN_2 ' sl::POSITIONAL_TRACKING_MODE::GEN_2'
473
+ GEN_3 ' sl::POSITIONAL_TRACKING_MODE::GEN_3'
457
474
458
475
String toString(POSITIONAL_TRACKING_MODE o)
459
476
@@ -537,6 +554,7 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
537
554
PERSON_HEAD_DETECTION ' sl::AI_MODELS::PERSON_HEAD_DETECTION'
538
555
PERSON_HEAD_ACCURATE_DETECTION ' sl::AI_MODELS::PERSON_HEAD_ACCURATE_DETECTION'
539
556
REID_ASSOCIATION ' sl::AI_MODELS::REID_ASSOCIATION'
557
+ NEURAL_LIGHT_DEPTH ' sl::AI_MODELS::NEURAL_LIGHT_DEPTH'
540
558
NEURAL_DEPTH ' sl::AI_MODELS::NEURAL_DEPTH'
541
559
NEURAL_PLUS_DEPTH ' sl::AI_MODELS::NEURAL_PLUS_DEPTH'
542
560
LAST ' sl::AI_MODELS::LAST'
@@ -565,6 +583,13 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
565
583
NMS3D_PER_CLASS ' sl::OBJECT_FILTERING_MODE::NMS3D_PER_CLASS'
566
584
LAST ' sl::OBJECT_FILTERING_MODE::LAST'
567
585
586
+ ctypedef enum OBJECT_ACCELERATION_PRESET ' sl::OBJECT_ACCELERATION_PRESET' :
587
+ ACC_PRESET_DEFAULT ' sl::OBJECT_ACCELERATION_PRESET::DEFAULT'
588
+ ACC_PRESET_LOW ' sl::OBJECT_ACCELERATION_PRESET::LOW'
589
+ ACC_PRESET_MEDIUM ' sl::OBJECT_ACCELERATION_PRESET::MEDIUM'
590
+ ACC_PRESET_HIGH ' sl::OBJECT_ACCELERATION_PRESET::HIGH'
591
+ ACC_PRESET_LAST ' sl::OBJECT_ACCELERATION_PRESET::LAST'
592
+
568
593
cdef struct RecordingStatus:
569
594
bool is_recording
570
595
bool is_paused
@@ -580,8 +605,8 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
580
605
Timestamp getCurrentTimeStamp()
581
606
582
607
cdef struct Resolution:
583
- size_t width
584
- size_t height
608
+ int width
609
+ int height
585
610
586
611
cdef cppclass Rect ' sl::Rect' :
587
612
size_t x
@@ -650,14 +675,36 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
650
675
CameraConfiguration camera_configuration
651
676
SensorsConfiguration sensors_configuration
652
677
678
+
679
+ cdef struct CameraOneConfiguration:
680
+ CameraParameters calibration_parameters
681
+ CameraParameters calibration_parameters_raw
682
+ unsigned int firmware_version
683
+ float fps
684
+ Resolution resolution
685
+
686
+
687
+ cdef struct CameraOneInformation:
688
+ unsigned int serial_number
689
+ MODEL camera_model
690
+ INPUT_TYPE input_type
691
+ CameraOneConfiguration camera_configuration
692
+ SensorsConfiguration sensors_configuration
693
+
694
+
653
695
ctypedef enum MEM ' sl::MEM' :
654
696
CPU ' sl::MEM::CPU'
697
+ GPU ' sl::MEM::GPU'
698
+ BOTH ' sl::MEM::BOTH'
655
699
656
700
MEM operator| (MEM a, MEM b)
657
701
658
702
659
703
ctypedef enum COPY_TYPE ' sl::COPY_TYPE' :
660
704
CPU_CPU ' sl::COPY_TYPE::CPU_CPU'
705
+ GPU_CPU ' sl::COPY_TYPE::GPU_CPU'
706
+ CPU_GPU ' sl::COPY_TYPE::CPU_GPU'
707
+ GPU_GPU ' sl::COPY_TYPE::GPU_GPU'
661
708
662
709
ctypedef enum MAT_TYPE ' sl::MAT_TYPE' :
663
710
F32_C1 ' sl::MAT_TYPE::F32_C1'
@@ -794,6 +841,11 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
794
841
bool is_static
795
842
float tracking_timeout
796
843
float tracking_max_dist
844
+ float max_box_width_meters
845
+ float min_box_width_meters
846
+ float max_box_height_meters
847
+ float min_box_height_meters
848
+ float max_allowed_acceleration
797
849
798
850
cdef cppclass CustomMaskObjectData ' sl::CustomMaskObjectData' :
799
851
String unique_object_id
@@ -804,6 +856,11 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
804
856
bool is_static
805
857
float tracking_timeout
806
858
float tracking_max_dist
859
+ float max_box_width_meters
860
+ float min_box_width_meters
861
+ float max_box_height_meters
862
+ float min_box_height_meters
863
+ float max_allowed_acceleration
807
864
Mat box_mask
808
865
809
866
cdef cppclass ObjectsBatch ' sl::ObjectsBatch' :
@@ -997,6 +1054,8 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
997
1054
void free(MEM memory_type)
998
1055
Mat & operator= (const Mat & that)
999
1056
ERROR_CODE copyTo(Mat & dst, COPY_TYPE cpyType) const
1057
+ ERROR_CODE updateCPUfromGPU()
1058
+ ERROR_CODE updateGPUfromCPU()
1000
1059
ERROR_CODE setFrom(const Mat & src, COPY_TYPE cpyType) const
1001
1060
ERROR_CODE read(const char * filePath)
1002
1061
ERROR_CODE write(const char * filePath, MEM memory_type, int compression_level)
@@ -1015,10 +1074,18 @@ cdef extern from "sl/Camera.hpp" namespace "sl":
1015
1074
bool isMemoryOwner()
1016
1075
ERROR_CODE clone(const Mat & src)
1017
1076
ERROR_CODE move(Mat & dst)
1077
+ ERROR_CODE convertColor(MEM memory_type)
1018
1078
1019
1079
@staticmethod
1020
1080
void swap(Mat & mat1, Mat & mat2)
1021
1081
1082
+ @staticmethod
1083
+ ERROR_CODE convertColor(Mat & mat1, Mat & mat2, bool swap_RB_channels, bool remove_alpha_channels, MEM memory_type)
1084
+
1085
+
1086
+ cdef ERROR_CODE blobFromImage(Mat & mat1, Mat & mat2, Resolution resolution, float scale, Vector3[float ] mean, Vector3[float ] stdev, bool keep_aspect_ratio, bool swap_RB_channels)
1087
+ cdef ERROR_CODE blobFromImages(vector[Mat] & mats, Mat & mat2, Resolution resolution, float scale, Vector3[float ] mean, Vector3[float ] stdev, bool keep_aspect_ratio, bool swap_RB_channels)
1088
+
1022
1089
cdef cppclass Rotation(Matrix3f):
1023
1090
Rotation() except +
1024
1091
Rotation(const Rotation & rotation) except +
@@ -1328,6 +1395,7 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1328
1395
float grab_compute_capping_fps
1329
1396
bool async_image_retrieval
1330
1397
int enable_image_validity_check
1398
+ Resolution maximum_working_resolution
1331
1399
1332
1400
InitParameters(RESOLUTION camera_resolution,
1333
1401
int camera_fps,
@@ -1354,7 +1422,8 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1354
1422
bool async_grab_camera_recovery,
1355
1423
float grab_compute_capping_fps,
1356
1424
bool async_image_retrieval,
1357
- int enable_image_validity_check)
1425
+ int enable_image_validity_check,
1426
+ Resolution maximum_working_resolution)
1358
1427
1359
1428
bool save(String filename)
1360
1429
bool load(String filename)
@@ -1534,6 +1603,13 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1534
1603
float min_box_width_normalized
1535
1604
float max_box_height_normalized
1536
1605
float min_box_height_normalized
1606
+ float max_box_width_meters
1607
+ float min_box_width_meters
1608
+ float max_box_height_meters
1609
+ float min_box_height_meters
1610
+ OBJECT_SUBCLASS native_mapped_class
1611
+ OBJECT_ACCELERATION_PRESET object_acceleration_preset
1612
+ float max_allowed_acceleration
1537
1613
CustomObjectDetectionProperties(bool enabled,
1538
1614
float detection_confidence_threshold,
1539
1615
bool is_grounded,
@@ -1543,7 +1619,14 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1543
1619
float max_box_width_normalized,
1544
1620
float min_box_width_normalized,
1545
1621
float max_box_height_normalized,
1546
- float min_box_height_normalized)
1622
+ float min_box_height_normalized,
1623
+ float max_box_width_meters,
1624
+ float min_box_width_meters,
1625
+ float max_box_height_meters,
1626
+ float min_box_height_meters,
1627
+ OBJECT_SUBCLASS native_mapped_class,
1628
+ OBJECT_ACCELERATION_PRESET object_acceleration_preset,
1629
+ float max_allowed_acceleration)
1547
1630
1548
1631
cdef cppclass CustomObjectDetectionRuntimeParameters:
1549
1632
CustomObjectDetectionProperties object_detection_properties
@@ -1611,6 +1694,14 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1611
1694
float twist[6 ]
1612
1695
float twist_covariance[36 ]
1613
1696
1697
+ cdef cppclass Landmark:
1698
+ unsigned long long id
1699
+ Vector3[float ] position
1700
+
1701
+ cdef cppclass Landmark2D:
1702
+ unsigned long long id
1703
+ Vector2[unsigned int ] image_position
1704
+
1614
1705
ctypedef enum CAMERA_MOTION_STATE ' sl::SensorsData::CAMERA_MOTION_STATE' :
1615
1706
STATIC ' sl::SensorsData::CAMERA_MOTION_STATE::STATIC'
1616
1707
MOVING ' sl::SensorsData::CAMERA_MOTION_STATE::MOVING'
@@ -1695,6 +1786,13 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1695
1786
1696
1787
Resolution getResolution(RESOLUTION resolution)
1697
1788
1789
+ cdef cppclass HealthStatus:
1790
+ bool enabled
1791
+ bool low_image_quality
1792
+ bool low_lighting
1793
+ bool low_depth_reliability
1794
+ bool low_motion_sensors_reliability
1795
+
1698
1796
cdef cppclass Camera ' sl::Camera' :
1699
1797
Camera()
1700
1798
void close()
@@ -1703,6 +1801,7 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1703
1801
InitParameters getInitParameters()
1704
1802
1705
1803
bool isOpened()
1804
+ ERROR_CODE read()
1706
1805
ERROR_CODE grab(RuntimeParameters rt_parameters)
1707
1806
1708
1807
RuntimeParameters getRuntimeParameters()
@@ -1748,6 +1847,8 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1748
1847
ERROR_CODE enablePositionalTracking(PositionalTrackingParameters tracking_params)
1749
1848
POSITIONAL_TRACKING_STATE getPosition(Pose & camera_pose, REFERENCE_FRAME reference_frame)
1750
1849
PositionalTrackingStatus getPositionalTrackingStatus()
1850
+ ERROR_CODE getPositionalTrackingLandmarks(map [uint64_t, Landmark] & landmarks)
1851
+ ERROR_CODE getPositionalTrackingLandmarks2D(vector[Landmark2D] & current_2d_landmarks)
1751
1852
ERROR_CODE saveAreaMap(String area_file_path)
1752
1853
AREA_EXPORTING_STATE getAreaExportState()
1753
1854
@@ -1793,6 +1894,7 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1793
1894
ERROR_CODE enableObjectDetection(ObjectDetectionParameters object_detection_parameters)
1794
1895
void disableObjectDetection(unsigned int instance_module_id, bool force_disable_all_instances)
1795
1896
ERROR_CODE retrieveObjects(Objects & objects, ObjectDetectionRuntimeParameters parameters, unsigned int instance_module_id)
1897
+ ERROR_CODE retrieveCustomObjects(Objects & objects, CustomObjectDetectionRuntimeParameters parameters, unsigned int instance_module_id)
1796
1898
ERROR_CODE getObjectsBatch(vector[ObjectsBatch] & trajectories, unsigned int instance_module_id)
1797
1899
bool isObjectDetectionEnabled(unsigned int instance_id)
1798
1900
ERROR_CODE ingestCustomBoxObjects(const vector[CustomBoxObjectData] & objects_in, const unsigned int instance_module_id)
@@ -1808,6 +1910,11 @@ cdef extern from 'sl/Camera.hpp' namespace 'sl':
1808
1910
bool isBodyTrackingEnabled(unsigned int instance_id)
1809
1911
BodyTrackingParameters getBodyTrackingParameters(unsigned int instance_id)
1810
1912
1913
+ HealthStatus getHealthStatus()
1914
+
1915
+ Resolution getRetrieveImageResolution(Resolution res)
1916
+ Resolution getRetrieveMeasureResolution(Resolution res)
1917
+
1811
1918
@staticmethod
1812
1919
String getSDKVersion()
1813
1920
@@ -1865,13 +1972,18 @@ cdef extern from "sl/Fusion.hpp" namespace "sl":
1865
1972
bool output_performance_metrics
1866
1973
bool verbose
1867
1974
unsigned timeout_period_number
1975
+ int sdk_gpu_id
1976
+ CUcontext sdk_cuda_ctx
1868
1977
SynchronizationParameter synchronization_parameters
1978
+
1869
1979
InitFusionParameters(
1870
1980
UNIT coordinate_units_,
1871
1981
COORDINATE_SYSTEM coordinate_system_,
1872
1982
bool output_performance_metrics,
1873
1983
bool verbose_,
1874
1984
unsigned timeout_period_number,
1985
+ int sdk_gpu_id,
1986
+ CUcontext sdk_cuda_ctx,
1875
1987
SynchronizationParameter synchronization_parameters_
1876
1988
)
1877
1989
@@ -2068,7 +2180,6 @@ cdef extern from "sl/CameraOne.hpp" namespace "sl":
2068
2180
String sdk_verbose_log_file
2069
2181
InputType input
2070
2182
String optional_settings_path
2071
- float open_timeout_sec
2072
2183
bool async_grab_camera_recovery
2073
2184
2074
2185
cdef cppclass CameraOne ' sl::CameraOne' :
@@ -2102,7 +2213,7 @@ cdef extern from "sl/CameraOne.hpp" namespace "sl":
2102
2213
float getCurrentFPS()
2103
2214
Timestamp getTimestamp(TIME_REFERENCE reference_time)
2104
2215
unsigned int getFrameDroppedCount()
2105
- CameraInformation getCameraInformation(Resolution resizer)
2216
+ CameraOneInformation getCameraInformation(Resolution resizer)
2106
2217
2107
2218
ERROR_CODE enableRecording(RecordingParameters recording_params)
2108
2219
@@ -2111,8 +2222,10 @@ cdef extern from "sl/CameraOne.hpp" namespace "sl":
2111
2222
2112
2223
RecordingStatus getRecordingStatus()
2113
2224
void pauseRecording(bool status)
2114
-
2115
2225
void disableRecording()
2226
+ ERROR_CODE ingestDataIntoSVO(SVOData& data)
2227
+ ERROR_CODE retrieveSVOData(string & key, map [Timestamp, SVOData] & data, Timestamp ts_begin, Timestamp ts_end)
2228
+ vector[string] getSVODataKeys()
2116
2229
2117
2230
ERROR_CODE enableStreaming(StreamingParameters streaming_parameters)
2118
2231
void disableStreaming()
0 commit comments