pyorbbec 1.0.1.19__tar.gz → 1.0.1.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyorbbec-1.0.1.21/PKG-INFO +7 -0
- pyorbbec-1.0.1.21/pyorbbec.egg-info/PKG-INFO +7 -0
- pyorbbec-1.0.1.21/pyorbbec.egg-info/SOURCES.txt +13 -0
- pyorbbec-1.0.1.21/pyorbbec.egg-info/top_level.txt +1 -0
- pyorbbec-1.0.1.21/pyproject.toml +3 -0
- pyorbbec-1.0.1.21/setup.py +77 -0
- pyorbbec-1.0.1.21/test/test_context.py +54 -0
- pyorbbec-1.0.1.21/test/test_device.py +84 -0
- pyorbbec-1.0.1.21/test/test_pipeline.py +47 -0
- pyorbbec-1.0.1.21/test/test_sensor_control.py +474 -0
- pyorbbec-1.0.1.19/MANIFEST.in +0 -3
- pyorbbec-1.0.1.19/NOTICE +0 -2
- pyorbbec-1.0.1.19/PKG-INFO +0 -22
- pyorbbec-1.0.1.19/pyproject.toml +0 -4
- pyorbbec-1.0.1.19/setup.py +0 -91
- pyorbbec-1.0.1.19/src/pyorbbec.egg-info/PKG-INFO +0 -22
- pyorbbec-1.0.1.19/src/pyorbbec.egg-info/SOURCES.txt +0 -49
- pyorbbec-1.0.1.19/src/pyorbbec.egg-info/not-zip-safe +0 -1
- pyorbbec-1.0.1.19/src/pyorbbec.egg-info/requires.txt +0 -8
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/.gitkeep +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/README.md +0 -26
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/callback.py +0 -303
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/color.py +0 -64
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/coordinate_transform.py +0 -184
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/depth.py +0 -107
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/depth_work_mode.py +0 -50
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/device_firmware_update.py +0 -155
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/device_optional_depth_presets_update.py +0 -142
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/enumerate.py +0 -118
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hdr.py +0 -216
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hot_plug.py +0 -160
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hw_d2c_align.py +0 -135
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/imu.py +0 -60
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/infrared.py +0 -115
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/logger.py +0 -55
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/metadata.py +0 -64
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/multi_device.py +0 -169
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/multi_streams.py +0 -219
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/net_device.py +0 -158
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/playback.py +0 -277
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/point_cloud.py +0 -90
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/post_processing.py +0 -119
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/preset.py +0 -67
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/quick_start.py +0 -90
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/recorder.py +0 -236
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/requirements.txt +0 -9
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/save_image_to_disk.py +0 -106
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/sync_align.py +0 -109
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/two_devices_sync.py +0 -233
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/utils.py +0 -127
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/depthengine/libdepthengine.so +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/depthengine/libdepthengine.so.2.0 +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/filters/libFilterProcessor.so +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/filters/libob_priv_filter.so +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/firmwareupdater/libfirmwareupdater.so +0 -0
- pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/frameprocessor/libob_frame_processor.so +0 -0
- {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/LICENSE +0 -0
- {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/README.md +0 -0
- {pyorbbec-1.0.1.19/src → pyorbbec-1.0.1.21}/pyorbbec.egg-info/dependency_links.txt +0 -0
- /pyorbbec-1.0.1.19/src/pyorbbec.egg-info/top_level.txt → /pyorbbec-1.0.1.21/pyorbbec.egg-info/not-zip-safe +0 -0
- {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/setup.cfg +0 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
LICENSE
|
2
|
+
README.md
|
3
|
+
pyproject.toml
|
4
|
+
setup.py
|
5
|
+
pyorbbec.egg-info/PKG-INFO
|
6
|
+
pyorbbec.egg-info/SOURCES.txt
|
7
|
+
pyorbbec.egg-info/dependency_links.txt
|
8
|
+
pyorbbec.egg-info/not-zip-safe
|
9
|
+
pyorbbec.egg-info/top_level.txt
|
10
|
+
test/test_context.py
|
11
|
+
test/test_device.py
|
12
|
+
test/test_pipeline.py
|
13
|
+
test/test_sensor_control.py
|
@@ -0,0 +1 @@
|
|
1
|
+
pyorbbecsdk
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# ******************************************************************************
|
2
|
+
# Copyright (c) 2024 Orbbec 3D Technology, Inc
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http:# www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
# ******************************************************************************
|
16
|
+
|
17
|
+
import os
|
18
|
+
import shutil
|
19
|
+
|
20
|
+
from setuptools import setup, Extension
|
21
|
+
from setuptools.command.build_ext import build_ext
|
22
|
+
|
23
|
+
|
24
|
+
class PrebuiltExtension(Extension):
|
25
|
+
def __init__(self, name, lib_dir=''):
|
26
|
+
super().__init__(name, sources=[]) # No sources to compile
|
27
|
+
self.lib_dir = os.path.abspath(lib_dir)
|
28
|
+
|
29
|
+
|
30
|
+
class CustomBuildExt(build_ext):
|
31
|
+
def run(self):
|
32
|
+
for ext in self.extensions:
|
33
|
+
self.build_extension(ext)
|
34
|
+
|
35
|
+
def build_extension(self, ext):
|
36
|
+
# Check if the lib directory exists and contains files
|
37
|
+
if not os.path.isdir(ext.lib_dir) or not os.listdir(ext.lib_dir):
|
38
|
+
raise FileNotFoundError(
|
39
|
+
f"Directory '{ext.lib_dir}' is empty or does not exist. "
|
40
|
+
"Please compile the necessary components with CMake as described in the README."
|
41
|
+
)
|
42
|
+
|
43
|
+
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
|
44
|
+
os.makedirs(extdir, exist_ok=True) # Ensure the destination path exists
|
45
|
+
self.copy_all_files(ext.lib_dir, extdir)
|
46
|
+
|
47
|
+
def copy_all_files(self, source_dir, destination_dir):
|
48
|
+
os.makedirs(destination_dir, exist_ok=True) # Ensure the entire destination directory structure exists
|
49
|
+
|
50
|
+
for item in os.listdir(source_dir):
|
51
|
+
source_path = os.path.join(source_dir, item)
|
52
|
+
destination_path = os.path.join(destination_dir, item)
|
53
|
+
|
54
|
+
if os.path.islink(source_path):
|
55
|
+
link_target = os.readlink(source_path)
|
56
|
+
if os.path.exists(destination_path):
|
57
|
+
os.remove(destination_path)
|
58
|
+
os.symlink(link_target, destination_path)
|
59
|
+
print(f"Preserved symbolic link {destination_path} -> {link_target}")
|
60
|
+
elif os.path.isdir(source_path):
|
61
|
+
self.copy_all_files(source_path, destination_path)
|
62
|
+
else:
|
63
|
+
shutil.copy2(source_path, destination_path)
|
64
|
+
print(f"Copied {source_path} to {destination_path}")
|
65
|
+
|
66
|
+
|
67
|
+
setup(
|
68
|
+
name='pyorbbec',
|
69
|
+
version='1.0.1.21',
|
70
|
+
author='zhonghong',
|
71
|
+
author_email='zhonghong@orbbec.com',
|
72
|
+
description='pyorbbecsdk is a python wrapper for the OrbbecSDK',
|
73
|
+
long_description='',
|
74
|
+
ext_modules=[PrebuiltExtension('pyorbbecsdk', 'install/lib')],
|
75
|
+
cmdclass={'build_ext': CustomBuildExt},
|
76
|
+
zip_safe=False,
|
77
|
+
)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import unittest
|
2
|
+
from pyorbbecsdk import *
|
3
|
+
|
4
|
+
|
5
|
+
def on_device_connected_callback(_: DeviceList):
|
6
|
+
print("on_device_connected_callback")
|
7
|
+
|
8
|
+
|
9
|
+
def on_device_disconnected_callback(_: DeviceList):
|
10
|
+
print("on_device_disconnected_callback")
|
11
|
+
|
12
|
+
|
13
|
+
def on_set_device_changed_callback(disconn_list: DeviceList, conn_list: DeviceList):
|
14
|
+
on_device_disconnected_callback(disconn_list)
|
15
|
+
on_device_connected_callback(conn_list)
|
16
|
+
|
17
|
+
|
18
|
+
class ContextTest(unittest.TestCase):
|
19
|
+
|
20
|
+
def setUp(self) -> None:
|
21
|
+
self.context = Context()
|
22
|
+
|
23
|
+
def tearDown(self) -> None:
|
24
|
+
self.context = None
|
25
|
+
|
26
|
+
def test_get_device_list(self):
|
27
|
+
device_list = self.context.query_devices()
|
28
|
+
self.assertIsNotNone(device_list)
|
29
|
+
self.assertGreater(device_list.get_count(), 0)
|
30
|
+
|
31
|
+
def test_setup_logger_level(self):
|
32
|
+
self.context.set_logger_level(OBLogLevel.DEBUG)
|
33
|
+
self.context.set_logger_level(OBLogLevel.INFO)
|
34
|
+
self.context.set_logger_level(OBLogLevel.WARNING)
|
35
|
+
self.context.set_logger_level(OBLogLevel.ERROR)
|
36
|
+
self.context.set_logger_level(OBLogLevel.FATAL)
|
37
|
+
self.context.set_logger_level(OBLogLevel.NONE)
|
38
|
+
|
39
|
+
def test_set_device_changed_callback(self):
|
40
|
+
self.context.set_device_changed_callback(on_set_device_changed_callback)
|
41
|
+
|
42
|
+
def test_enable_multi_device_sync(self):
|
43
|
+
self.context.enable_multi_device_sync(100)
|
44
|
+
|
45
|
+
def test_set_logger_to_console(self):
|
46
|
+
self.context.set_logger_to_console(OBLogLevel.DEBUG)
|
47
|
+
|
48
|
+
def test_set_logger_to_file(self):
|
49
|
+
self.context.set_logger_to_file(OBLogLevel.DEBUG, "test.log")
|
50
|
+
|
51
|
+
|
52
|
+
if __name__ == '__main__':
|
53
|
+
print("Start test Context interface, Please make sure you have connected a device to your computer.")
|
54
|
+
unittest.main()
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import unittest
|
2
|
+
from pyorbbecsdk import *
|
3
|
+
|
4
|
+
|
5
|
+
class DeviceTest(unittest.TestCase):
|
6
|
+
def setUp(self) -> None:
|
7
|
+
self.context = Context()
|
8
|
+
device_list = self.context.query_devices()
|
9
|
+
self.assertIsNotNone(device_list)
|
10
|
+
self.assertGreater(device_list.get_count(), 0)
|
11
|
+
self.device = device_list.get_device_by_index(0)
|
12
|
+
self.assertIsNotNone(self.device)
|
13
|
+
|
14
|
+
def tearDown(self) -> None:
|
15
|
+
self.device = None
|
16
|
+
self.context = None
|
17
|
+
|
18
|
+
def test_get_device_info(self):
|
19
|
+
device_info = self.device.get_device_info()
|
20
|
+
self.assertIsNotNone(device_info)
|
21
|
+
self.assertIsNotNone(device_info.get_name())
|
22
|
+
self.assertIsNotNone(device_info.get_pid())
|
23
|
+
self.assertIsNotNone(device_info.get_vid())
|
24
|
+
self.assertIsNotNone(device_info.get_serial_number())
|
25
|
+
self.assertIsNotNone(device_info.get_firmware_version())
|
26
|
+
self.assertIsNotNone(device_info.get_hardware_version())
|
27
|
+
self.assertIsNotNone(device_info.get_connection_type())
|
28
|
+
self.assertIsNotNone(device_info.get_device_type())
|
29
|
+
print("Device info: ", device_info)
|
30
|
+
|
31
|
+
def test_get_sensor_list(self):
|
32
|
+
sensor_list = self.device.get_sensor_list()
|
33
|
+
self.assertIsNotNone(sensor_list)
|
34
|
+
self.assertGreater(sensor_list.get_count(), 0)
|
35
|
+
for i in range(sensor_list.get_count()):
|
36
|
+
sensor = sensor_list.get_sensor_by_index(i)
|
37
|
+
self.assertIsNotNone(sensor)
|
38
|
+
self.assertIsNotNone(sensor.get_type())
|
39
|
+
print(sensor)
|
40
|
+
|
41
|
+
def test_get_depth_work_mode_list(self):
|
42
|
+
if not self.device.is_property_supported(OBPropertyID.OB_STRUCT_CURRENT_DEPTH_ALG_MODE,
|
43
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
44
|
+
print("Current device not support depth work mode!")
|
45
|
+
return
|
46
|
+
current_depth_work_mode = self.device.get_depth_work_mode()
|
47
|
+
self.assertIsNotNone(current_depth_work_mode)
|
48
|
+
print("Current depth work mode: ", current_depth_work_mode)
|
49
|
+
depth_work_mode_list = self.device.get_depth_work_mode_list()
|
50
|
+
self.assertIsNotNone(depth_work_mode_list)
|
51
|
+
self.assertGreater(depth_work_mode_list.get_count(), 0)
|
52
|
+
select_depth_work_mode = None
|
53
|
+
for i in range(depth_work_mode_list.get_count()):
|
54
|
+
depth_work_mode = depth_work_mode_list.get_depth_work_mode_by_index(i)
|
55
|
+
self.assertIsNotNone(depth_work_mode)
|
56
|
+
print(depth_work_mode)
|
57
|
+
if depth_work_mode != current_depth_work_mode:
|
58
|
+
select_depth_work_mode = depth_work_mode
|
59
|
+
if select_depth_work_mode is not None:
|
60
|
+
self.device.set_depth_work_mode(select_depth_work_mode)
|
61
|
+
self.assertEqual(select_depth_work_mode, self.device.get_depth_work_mode())
|
62
|
+
self.device.set_depth_work_mode(current_depth_work_mode)
|
63
|
+
self.assertEqual(current_depth_work_mode, self.device.get_depth_work_mode())
|
64
|
+
|
65
|
+
self.device.set_depth_work_mode(current_depth_work_mode)
|
66
|
+
|
67
|
+
def test_get_calib_camera_params(self):
|
68
|
+
calib_camera_params_list = self.device.get_calibration_camera_param_list()
|
69
|
+
self.assertIsNotNone(calib_camera_params_list)
|
70
|
+
self.assertGreater(calib_camera_params_list.get_count(), 0)
|
71
|
+
for i in range(calib_camera_params_list.get_count()):
|
72
|
+
calib_camera_params = calib_camera_params_list.get_camera_param(i)
|
73
|
+
self.assertIsNotNone(calib_camera_params)
|
74
|
+
print(calib_camera_params)
|
75
|
+
|
76
|
+
def test_get_temperature(self):
|
77
|
+
temperature = self.device.get_temperature()
|
78
|
+
self.assertIsNotNone(temperature)
|
79
|
+
print("Device temperature: ", temperature)
|
80
|
+
|
81
|
+
|
82
|
+
if __name__ == '__main__':
|
83
|
+
print("Start test Device interface, Please make sure you have connected a device to your computer.")
|
84
|
+
unittest.main()
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import unittest
|
2
|
+
from pyorbbecsdk import *
|
3
|
+
|
4
|
+
|
5
|
+
class PipelineTest(unittest.TestCase):
|
6
|
+
|
7
|
+
def setUp(self) -> None:
|
8
|
+
self.context = Context()
|
9
|
+
device_list = self.context.query_devices()
|
10
|
+
self.assertIsNotNone(device_list)
|
11
|
+
self.assertGreater(device_list.get_count(), 0)
|
12
|
+
self.device = device_list.get_device_by_index(0)
|
13
|
+
self.assertIsNotNone(self.device)
|
14
|
+
self.pipeline = Pipeline(self.device)
|
15
|
+
self.assertIsNotNone(self.pipeline)
|
16
|
+
|
17
|
+
def tearDown(self) -> None:
|
18
|
+
self.pipeline = None
|
19
|
+
self.device = None
|
20
|
+
self.context = None
|
21
|
+
|
22
|
+
def test_get_device_info(self):
|
23
|
+
device_info = self.device.get_device_info()
|
24
|
+
self.assertIsNotNone(device_info)
|
25
|
+
self.assertIsNotNone(device_info.get_name())
|
26
|
+
self.assertIsNotNone(device_info.get_pid())
|
27
|
+
self.assertIsNotNone(device_info.get_vid())
|
28
|
+
self.assertIsNotNone(device_info.get_serial_number())
|
29
|
+
self.assertIsNotNone(device_info.get_firmware_version())
|
30
|
+
self.assertIsNotNone(device_info.get_hardware_version())
|
31
|
+
self.assertIsNotNone(device_info.get_connection_type())
|
32
|
+
self.assertIsNotNone(device_info.get_device_type())
|
33
|
+
print("Device info: ", device_info)
|
34
|
+
|
35
|
+
def test_get_camera_param(self):
|
36
|
+
camera_param = self.pipeline.get_camera_param()
|
37
|
+
self.assertIsNotNone(camera_param)
|
38
|
+
print(camera_param.depth_intrinsic)
|
39
|
+
print(camera_param.rgb_intrinsic)
|
40
|
+
print(camera_param.depth_distortion)
|
41
|
+
print(camera_param.rgb_distortion)
|
42
|
+
print(camera_param.transform)
|
43
|
+
|
44
|
+
|
45
|
+
if __name__ == '__main__':
|
46
|
+
print("Start test Pipeline interface, Please make sure you have connected a device to your computer.")
|
47
|
+
unittest.main()
|