pyorbbec 1.0.1.18__tar.gz → 1.0.1.20__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.20/PKG-INFO +7 -0
- pyorbbec-1.0.1.20/pyorbbec.egg-info/PKG-INFO +7 -0
- pyorbbec-1.0.1.20/pyorbbec.egg-info/SOURCES.txt +13 -0
- pyorbbec-1.0.1.20/pyorbbec.egg-info/top_level.txt +1 -0
- pyorbbec-1.0.1.20/pyproject.toml +3 -0
- pyorbbec-1.0.1.20/setup.py +77 -0
- pyorbbec-1.0.1.20/test/test_context.py +54 -0
- pyorbbec-1.0.1.20/test/test_device.py +84 -0
- pyorbbec-1.0.1.20/test/test_pipeline.py +47 -0
- pyorbbec-1.0.1.20/test/test_sensor_control.py +474 -0
- pyorbbec-1.0.1.18/MANIFEST.in +0 -3
- pyorbbec-1.0.1.18/NOTICE +0 -2
- pyorbbec-1.0.1.18/PKG-INFO +0 -22
- pyorbbec-1.0.1.18/pyproject.toml +0 -4
- pyorbbec-1.0.1.18/setup.py +0 -91
- pyorbbec-1.0.1.18/src/pyorbbec.egg-info/PKG-INFO +0 -22
- pyorbbec-1.0.1.18/src/pyorbbec.egg-info/SOURCES.txt +0 -12
- pyorbbec-1.0.1.18/src/pyorbbec.egg-info/not-zip-safe +0 -1
- pyorbbec-1.0.1.18/src/pyorbbec.egg-info/requires.txt +0 -8
- {pyorbbec-1.0.1.18 → pyorbbec-1.0.1.20}/LICENSE +0 -0
- {pyorbbec-1.0.1.18 → pyorbbec-1.0.1.20}/README.md +0 -0
- {pyorbbec-1.0.1.18/src → pyorbbec-1.0.1.20}/pyorbbec.egg-info/dependency_links.txt +0 -0
- /pyorbbec-1.0.1.18/src/pyorbbec.egg-info/top_level.txt → /pyorbbec-1.0.1.20/pyorbbec.egg-info/not-zip-safe +0 -0
- {pyorbbec-1.0.1.18 → pyorbbec-1.0.1.20}/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.20',
|
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()
|
@@ -0,0 +1,474 @@
|
|
1
|
+
import unittest
|
2
|
+
from pyorbbecsdk import *
|
3
|
+
|
4
|
+
|
5
|
+
class SensorControlTest(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
|
+
self.pipeline = Pipeline(self.device)
|
14
|
+
|
15
|
+
def tearDown(self) -> None:
|
16
|
+
self.pipeline = None
|
17
|
+
self.device = None
|
18
|
+
self.context = None
|
19
|
+
|
20
|
+
def turn_off_depth_auto_exposure(self):
|
21
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL,
|
22
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
23
|
+
print("Current device not support depth auto exposure!")
|
24
|
+
return
|
25
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, False)
|
26
|
+
|
27
|
+
def turn_on_depth_auto_exposure(self):
|
28
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL,
|
29
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
30
|
+
print("Current device not support depth auto exposure!")
|
31
|
+
return
|
32
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, True)
|
33
|
+
|
34
|
+
def turn_off_ir_auto_exposure(self):
|
35
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL,
|
36
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
37
|
+
print("Current device not support ir auto exposure!")
|
38
|
+
return
|
39
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL, False)
|
40
|
+
|
41
|
+
def turn_on_ir_auto_exposure(self):
|
42
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL,
|
43
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
44
|
+
print("Current device not support ir auto exposure!")
|
45
|
+
return
|
46
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL, True)
|
47
|
+
|
48
|
+
def turn_off_color_auto_exposure(self):
|
49
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL,
|
50
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
51
|
+
print("Current device not support color auto exposure!")
|
52
|
+
return
|
53
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL, False)
|
54
|
+
|
55
|
+
def turn_on_color_auto_exposure(self):
|
56
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL,
|
57
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
58
|
+
print("Current device not support color auto exposure!")
|
59
|
+
return
|
60
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL, True)
|
61
|
+
|
62
|
+
def test_get_and_set_ir_gain(self):
|
63
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_GAIN_INT,
|
64
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
65
|
+
print("Current device not support ir gain!")
|
66
|
+
return
|
67
|
+
self.turn_off_ir_auto_exposure()
|
68
|
+
curr_ir_gain = self.device.get_int_property(OBPropertyID.OB_PROP_IR_GAIN_INT)
|
69
|
+
self.assertIsNotNone(curr_ir_gain)
|
70
|
+
print("Current ir gain: ", curr_ir_gain)
|
71
|
+
ir_gain = curr_ir_gain + 1
|
72
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_IR_GAIN_INT, ir_gain)
|
73
|
+
new_ir_gain = self.device.get_int_property(OBPropertyID.OB_PROP_IR_GAIN_INT)
|
74
|
+
self.assertIsNotNone(new_ir_gain)
|
75
|
+
self.assertEqual(new_ir_gain, ir_gain)
|
76
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_IR_GAIN_INT, curr_ir_gain)
|
77
|
+
self.turn_on_ir_auto_exposure()
|
78
|
+
|
79
|
+
def test_get_and_set_color_gain(self):
|
80
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_GAIN_INT,
|
81
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
82
|
+
print("Current device not support color gain!")
|
83
|
+
return
|
84
|
+
self.turn_off_color_auto_exposure()
|
85
|
+
curr_color_gain = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_GAIN_INT)
|
86
|
+
self.assertIsNotNone(curr_color_gain)
|
87
|
+
print("Current color gain: ", curr_color_gain)
|
88
|
+
color_gain = curr_color_gain + 1
|
89
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_GAIN_INT, color_gain)
|
90
|
+
new_color_gain = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_GAIN_INT)
|
91
|
+
self.assertIsNotNone(new_color_gain)
|
92
|
+
self.assertEqual(new_color_gain, color_gain)
|
93
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_GAIN_INT, curr_color_gain)
|
94
|
+
self.turn_on_color_auto_exposure()
|
95
|
+
|
96
|
+
def test_get_and_set_depth_gain(self):
|
97
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_GAIN_INT,
|
98
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
99
|
+
print("Current device not support depth gain!")
|
100
|
+
return
|
101
|
+
self.turn_off_depth_auto_exposure()
|
102
|
+
curr_depth_gain = self.device.get_int_property(OBPropertyID.OB_PROP_DEPTH_GAIN_INT)
|
103
|
+
self.assertIsNotNone(curr_depth_gain)
|
104
|
+
print("Current depth gain: ", curr_depth_gain)
|
105
|
+
depth_gain = curr_depth_gain + 1
|
106
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_DEPTH_GAIN_INT, depth_gain)
|
107
|
+
new_depth_gain = self.device.get_int_property(OBPropertyID.OB_PROP_DEPTH_GAIN_INT)
|
108
|
+
self.assertIsNotNone(new_depth_gain)
|
109
|
+
self.assertEqual(new_depth_gain, depth_gain)
|
110
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_DEPTH_GAIN_INT, curr_depth_gain)
|
111
|
+
self.turn_on_depth_auto_exposure()
|
112
|
+
|
113
|
+
def test_get_and_set_color_exposure(self):
|
114
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_EXPOSURE_INT,
|
115
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
116
|
+
print("Current device not support color exposure!")
|
117
|
+
return
|
118
|
+
self.turn_off_color_auto_exposure()
|
119
|
+
curr_color_exposure = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_EXPOSURE_INT)
|
120
|
+
self.assertIsNotNone(curr_color_exposure)
|
121
|
+
print("Current color exposure: ", curr_color_exposure)
|
122
|
+
color_exposure = curr_color_exposure + 1
|
123
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_EXPOSURE_INT, color_exposure)
|
124
|
+
new_color_exposure = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_EXPOSURE_INT)
|
125
|
+
self.assertIsNotNone(new_color_exposure)
|
126
|
+
self.assertEqual(new_color_exposure, color_exposure)
|
127
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_EXPOSURE_INT, curr_color_exposure)
|
128
|
+
self.turn_on_color_auto_exposure()
|
129
|
+
|
130
|
+
def test_get_and_set_ir_exposure(self):
|
131
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_EXPOSURE_INT,
|
132
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
133
|
+
print("Current device not support ir exposure!")
|
134
|
+
return
|
135
|
+
self.turn_off_ir_auto_exposure()
|
136
|
+
curr_ir_exposure = self.device.get_int_property(OBPropertyID.OB_PROP_IR_EXPOSURE_INT)
|
137
|
+
self.assertIsNotNone(curr_ir_exposure)
|
138
|
+
print("Current ir exposure: ", curr_ir_exposure)
|
139
|
+
ir_exposure = curr_ir_exposure + 1
|
140
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_IR_EXPOSURE_INT, ir_exposure)
|
141
|
+
new_ir_exposure = self.device.get_int_property(OBPropertyID.OB_PROP_IR_EXPOSURE_INT)
|
142
|
+
self.assertIsNotNone(new_ir_exposure)
|
143
|
+
self.assertEqual(new_ir_exposure, ir_exposure)
|
144
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_IR_EXPOSURE_INT, curr_ir_exposure)
|
145
|
+
self.turn_on_ir_auto_exposure()
|
146
|
+
|
147
|
+
def test_get_and_set_color_auto_white_balance(self):
|
148
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL,
|
149
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
150
|
+
print("Current device not support color auto white balance!")
|
151
|
+
return
|
152
|
+
self.turn_on_color_auto_exposure()
|
153
|
+
curr_color_auto_white_balance = self.device.get_bool_property(
|
154
|
+
OBPropertyID.OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL)
|
155
|
+
self.assertIsNotNone(curr_color_auto_white_balance)
|
156
|
+
print("Current color auto white balance: ", curr_color_auto_white_balance)
|
157
|
+
color_auto_white_balance = not curr_color_auto_white_balance
|
158
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL,
|
159
|
+
color_auto_white_balance)
|
160
|
+
new_color_auto_white_balance = self.device.get_bool_property(
|
161
|
+
OBPropertyID.OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL)
|
162
|
+
self.assertIsNotNone(new_color_auto_white_balance)
|
163
|
+
self.assertEqual(new_color_auto_white_balance, color_auto_white_balance)
|
164
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL,
|
165
|
+
curr_color_auto_white_balance)
|
166
|
+
self.turn_off_color_auto_exposure()
|
167
|
+
|
168
|
+
def test_get_and_set_ldp(self):
|
169
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_LDP_BOOL,
|
170
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
171
|
+
print("Current device not support LDP!")
|
172
|
+
return
|
173
|
+
curr_ldp = self.device.get_bool_property(OBPropertyID.OB_PROP_LDP_BOOL)
|
174
|
+
self.assertIsNotNone(curr_ldp)
|
175
|
+
print("Current LDP: ", curr_ldp)
|
176
|
+
ldp = not curr_ldp
|
177
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_LDP_BOOL, ldp)
|
178
|
+
new_ldp = self.device.get_bool_property(OBPropertyID.OB_PROP_LDP_BOOL)
|
179
|
+
self.assertIsNotNone(new_ldp)
|
180
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_LDP_BOOL, curr_ldp)
|
181
|
+
|
182
|
+
def test_get_and_set_laser(self):
|
183
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_LASER_BOOL,
|
184
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
185
|
+
print("Current device not support laser!")
|
186
|
+
return
|
187
|
+
curr_laser = self.device.get_bool_property(OBPropertyID.OB_PROP_LASER_BOOL)
|
188
|
+
self.assertIsNotNone(curr_laser)
|
189
|
+
print("Current laser: ", curr_laser)
|
190
|
+
laser = not curr_laser
|
191
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_LASER_BOOL, laser)
|
192
|
+
new_laser = self.device.get_bool_property(OBPropertyID.OB_PROP_LASER_BOOL)
|
193
|
+
self.assertIsNotNone(new_laser)
|
194
|
+
self.assertEqual(new_laser, laser)
|
195
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_LASER_BOOL, curr_laser)
|
196
|
+
|
197
|
+
def test_get_and_set_flood(self):
|
198
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_FLOOD_BOOL,
|
199
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
200
|
+
print("Current device not support flood!")
|
201
|
+
return
|
202
|
+
curr_flood = self.device.get_bool_property(OBPropertyID.OB_PROP_FLOOD_BOOL)
|
203
|
+
self.assertIsNotNone(curr_flood)
|
204
|
+
print("Current flood: ", curr_flood)
|
205
|
+
flood = not curr_flood
|
206
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_FLOOD_BOOL, flood)
|
207
|
+
new_flood = self.device.get_bool_property(OBPropertyID.OB_PROP_FLOOD_BOOL)
|
208
|
+
self.assertIsNotNone(new_flood)
|
209
|
+
self.assertEqual(new_flood, flood)
|
210
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_FLOOD_BOOL, curr_flood)
|
211
|
+
|
212
|
+
def test_get_and_set_soft_filter(self):
|
213
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_SOFT_FILTER_BOOL,
|
214
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
215
|
+
print("Current device not support soft filter!")
|
216
|
+
return
|
217
|
+
curr_soft_filter = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_SOFT_FILTER_BOOL)
|
218
|
+
self.assertIsNotNone(curr_soft_filter)
|
219
|
+
print("Current soft filter: ", curr_soft_filter)
|
220
|
+
soft_filter = not curr_soft_filter
|
221
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_SOFT_FILTER_BOOL, soft_filter)
|
222
|
+
new_soft_filter = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_SOFT_FILTER_BOOL)
|
223
|
+
self.assertIsNotNone(new_soft_filter)
|
224
|
+
self.assertEqual(new_soft_filter, soft_filter)
|
225
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_SOFT_FILTER_BOOL, curr_soft_filter)
|
226
|
+
|
227
|
+
def test_get_and_set_color_mirror(self):
|
228
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_MIRROR_BOOL,
|
229
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
230
|
+
print("Current device not support color mirror!")
|
231
|
+
return
|
232
|
+
curr_color_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_MIRROR_BOOL)
|
233
|
+
self.assertIsNotNone(curr_color_mirror)
|
234
|
+
print("Current color mirror: ", curr_color_mirror)
|
235
|
+
color_mirror = not curr_color_mirror
|
236
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_MIRROR_BOOL, color_mirror)
|
237
|
+
new_color_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_MIRROR_BOOL)
|
238
|
+
self.assertIsNotNone(new_color_mirror)
|
239
|
+
self.assertEqual(new_color_mirror, color_mirror)
|
240
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_MIRROR_BOOL, curr_color_mirror)
|
241
|
+
|
242
|
+
def test_get_and_set_depth_mirror(self):
|
243
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_MIRROR_BOOL,
|
244
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
245
|
+
print("Current device not support depth mirror!")
|
246
|
+
return
|
247
|
+
curr_depth_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_MIRROR_BOOL)
|
248
|
+
self.assertIsNotNone(curr_depth_mirror)
|
249
|
+
print("Current depth mirror: ", curr_depth_mirror)
|
250
|
+
depth_mirror = not curr_depth_mirror
|
251
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_MIRROR_BOOL, depth_mirror)
|
252
|
+
new_depth_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_MIRROR_BOOL)
|
253
|
+
self.assertIsNotNone(new_depth_mirror)
|
254
|
+
self.assertEqual(new_depth_mirror, depth_mirror)
|
255
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_MIRROR_BOOL, curr_depth_mirror)
|
256
|
+
|
257
|
+
def test_get_and_set_ir_mirror(self):
|
258
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_MIRROR_BOOL,
|
259
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
260
|
+
print("Current device not support ir mirror!")
|
261
|
+
return
|
262
|
+
curr_ir_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_MIRROR_BOOL)
|
263
|
+
self.assertIsNotNone(curr_ir_mirror)
|
264
|
+
print("Current ir mirror: ", curr_ir_mirror)
|
265
|
+
ir_mirror = not curr_ir_mirror
|
266
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_MIRROR_BOOL, ir_mirror)
|
267
|
+
new_ir_mirror = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_MIRROR_BOOL)
|
268
|
+
self.assertIsNotNone(new_ir_mirror)
|
269
|
+
self.assertEqual(new_ir_mirror, ir_mirror)
|
270
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_MIRROR_BOOL, curr_ir_mirror)
|
271
|
+
|
272
|
+
def test_get_and_set_color_auto_exposure(self):
|
273
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL,
|
274
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
275
|
+
print("Current device not support color auto exposure!")
|
276
|
+
return
|
277
|
+
curr_color_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL)
|
278
|
+
self.assertIsNotNone(curr_color_auto_exposure)
|
279
|
+
print("Current color auto exposure: ", curr_color_auto_exposure)
|
280
|
+
color_auto_exposure = not curr_color_auto_exposure
|
281
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL, color_auto_exposure)
|
282
|
+
new_color_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL)
|
283
|
+
self.assertIsNotNone(new_color_auto_exposure)
|
284
|
+
self.assertEqual(new_color_auto_exposure, color_auto_exposure)
|
285
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_AUTO_EXPOSURE_BOOL, curr_color_auto_exposure)
|
286
|
+
|
287
|
+
def test_get_and_set_depth_auto_exposure(self):
|
288
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL,
|
289
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
290
|
+
print("Current device not support depth auto exposure!")
|
291
|
+
return
|
292
|
+
curr_depth_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL)
|
293
|
+
self.assertIsNotNone(curr_depth_auto_exposure)
|
294
|
+
print("Current depth auto exposure: ", curr_depth_auto_exposure)
|
295
|
+
depth_auto_exposure = not curr_depth_auto_exposure
|
296
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, depth_auto_exposure)
|
297
|
+
new_depth_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL)
|
298
|
+
self.assertIsNotNone(new_depth_auto_exposure)
|
299
|
+
self.assertEqual(new_depth_auto_exposure, depth_auto_exposure)
|
300
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, curr_depth_auto_exposure)
|
301
|
+
|
302
|
+
def test_get_and_set_ir_auto_exposure(self):
|
303
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL,
|
304
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
305
|
+
print("Current device not support ir auto exposure!")
|
306
|
+
return
|
307
|
+
curr_ir_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL)
|
308
|
+
self.assertIsNotNone(curr_ir_auto_exposure)
|
309
|
+
print("Current ir auto exposure: ", curr_ir_auto_exposure)
|
310
|
+
ir_auto_exposure = not curr_ir_auto_exposure
|
311
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL, ir_auto_exposure)
|
312
|
+
new_ir_auto_exposure = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL)
|
313
|
+
self.assertIsNotNone(new_ir_auto_exposure)
|
314
|
+
self.assertEqual(new_ir_auto_exposure, ir_auto_exposure)
|
315
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_AUTO_EXPOSURE_BOOL, curr_ir_auto_exposure)
|
316
|
+
|
317
|
+
def test_get_and_set_color_flip(self):
|
318
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_FLIP_BOOL,
|
319
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
320
|
+
print("Current device not support color flip!")
|
321
|
+
return
|
322
|
+
curr_color_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_FLIP_BOOL)
|
323
|
+
self.assertIsNotNone(curr_color_flip)
|
324
|
+
print("Current color flip: ", curr_color_flip)
|
325
|
+
color_flip = not curr_color_flip
|
326
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_FLIP_BOOL, color_flip)
|
327
|
+
new_color_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_COLOR_FLIP_BOOL)
|
328
|
+
self.assertIsNotNone(new_color_flip)
|
329
|
+
self.assertEqual(new_color_flip, color_flip)
|
330
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_COLOR_FLIP_BOOL, curr_color_flip)
|
331
|
+
|
332
|
+
def test_get_and_set_depth_flip(self):
|
333
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_DEPTH_FLIP_BOOL,
|
334
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
335
|
+
print("Current device not support depth flip!")
|
336
|
+
return
|
337
|
+
curr_depth_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_FLIP_BOOL)
|
338
|
+
self.assertIsNotNone(curr_depth_flip)
|
339
|
+
print("Current depth flip: ", curr_depth_flip)
|
340
|
+
depth_flip = not curr_depth_flip
|
341
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_FLIP_BOOL, depth_flip)
|
342
|
+
new_depth_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_DEPTH_FLIP_BOOL)
|
343
|
+
self.assertIsNotNone(new_depth_flip)
|
344
|
+
self.assertEqual(new_depth_flip, depth_flip)
|
345
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_DEPTH_FLIP_BOOL, curr_depth_flip)
|
346
|
+
|
347
|
+
def test_get_and_set_ir_flip(self):
|
348
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_IR_FLIP_BOOL,
|
349
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
350
|
+
print("Current device not support ir flip!")
|
351
|
+
return
|
352
|
+
curr_ir_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_FLIP_BOOL)
|
353
|
+
self.assertIsNotNone(curr_ir_flip)
|
354
|
+
print("Current ir flip: ", curr_ir_flip)
|
355
|
+
ir_flip = not curr_ir_flip
|
356
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_FLIP_BOOL, ir_flip)
|
357
|
+
new_ir_flip = self.device.get_bool_property(OBPropertyID.OB_PROP_IR_FLIP_BOOL)
|
358
|
+
self.assertIsNotNone(new_ir_flip)
|
359
|
+
self.assertEqual(new_ir_flip, ir_flip)
|
360
|
+
self.device.set_bool_property(OBPropertyID.OB_PROP_IR_FLIP_BOOL, curr_ir_flip)
|
361
|
+
|
362
|
+
def test_get_and_set_color_sharpness(self):
|
363
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_SHARPNESS_INT,
|
364
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
365
|
+
print("Current device not support color sharpness!")
|
366
|
+
return
|
367
|
+
self.turn_off_color_auto_exposure()
|
368
|
+
curr_color_sharpness = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_SHARPNESS_INT)
|
369
|
+
self.assertIsNotNone(curr_color_sharpness)
|
370
|
+
print("Current color sharpness: ", curr_color_sharpness)
|
371
|
+
color_sharpness = curr_color_sharpness + 1
|
372
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_SHARPNESS_INT, color_sharpness)
|
373
|
+
new_color_sharpness = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_SHARPNESS_INT)
|
374
|
+
self.assertIsNotNone(new_color_sharpness)
|
375
|
+
self.assertEqual(new_color_sharpness, color_sharpness)
|
376
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_SHARPNESS_INT, curr_color_sharpness)
|
377
|
+
self.turn_on_color_auto_exposure()
|
378
|
+
|
379
|
+
def test_get_and_set_color_hue(self):
|
380
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_HUE_INT,
|
381
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
382
|
+
print("Current device not support color hue!")
|
383
|
+
return
|
384
|
+
self.turn_off_color_auto_exposure()
|
385
|
+
curr_color_hue = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_HUE_INT)
|
386
|
+
self.assertIsNotNone(curr_color_hue)
|
387
|
+
print("Current color hue: ", curr_color_hue)
|
388
|
+
color_hue = curr_color_hue + 1
|
389
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_HUE_INT, color_hue)
|
390
|
+
new_color_hue = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_HUE_INT)
|
391
|
+
self.assertIsNotNone(new_color_hue)
|
392
|
+
self.assertEqual(new_color_hue, color_hue)
|
393
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_HUE_INT, curr_color_hue)
|
394
|
+
self.turn_on_color_auto_exposure()
|
395
|
+
|
396
|
+
def test_get_and_set_color_contrast(self):
|
397
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_CONTRAST_INT,
|
398
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
399
|
+
print("Current device not support color contrast!")
|
400
|
+
return
|
401
|
+
self.turn_off_color_auto_exposure()
|
402
|
+
curr_color_contrast = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_CONTRAST_INT)
|
403
|
+
self.assertIsNotNone(curr_color_contrast)
|
404
|
+
print("Current color contrast: ", curr_color_contrast)
|
405
|
+
color_contrast = curr_color_contrast + 1
|
406
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_CONTRAST_INT, color_contrast)
|
407
|
+
new_color_contrast = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_CONTRAST_INT)
|
408
|
+
self.assertIsNotNone(new_color_contrast)
|
409
|
+
self.assertEqual(new_color_contrast, color_contrast)
|
410
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_CONTRAST_INT, curr_color_contrast)
|
411
|
+
self.turn_on_color_auto_exposure()
|
412
|
+
|
413
|
+
def test_get_and_set_color_brightness(self):
|
414
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_COLOR_BRIGHTNESS_INT,
|
415
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
416
|
+
print("Current device not support color brightness!")
|
417
|
+
return
|
418
|
+
self.turn_off_color_auto_exposure()
|
419
|
+
curr_color_brightness = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_BRIGHTNESS_INT)
|
420
|
+
self.assertIsNotNone(curr_color_brightness)
|
421
|
+
print("Current color brightness: ", curr_color_brightness)
|
422
|
+
color_brightness = curr_color_brightness + 1
|
423
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_BRIGHTNESS_INT, color_brightness)
|
424
|
+
new_color_brightness = self.device.get_int_property(OBPropertyID.OB_PROP_COLOR_BRIGHTNESS_INT)
|
425
|
+
self.assertIsNotNone(new_color_brightness)
|
426
|
+
self.assertEqual(new_color_brightness, color_brightness)
|
427
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_COLOR_BRIGHTNESS_INT, curr_color_brightness)
|
428
|
+
self.turn_on_color_auto_exposure()
|
429
|
+
|
430
|
+
def test_get_and_set_depth_work_mode(self):
|
431
|
+
if not self.device.is_property_supported(OBPropertyID.OB_STRUCT_CURRENT_DEPTH_ALG_MODE,
|
432
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
433
|
+
print("Current device not support depth work mode!")
|
434
|
+
return
|
435
|
+
curr_depth_work_mode = self.device.get_depth_work_mode()
|
436
|
+
self.assertIsNotNone(curr_depth_work_mode)
|
437
|
+
print("Current depth work mode: ", curr_depth_work_mode)
|
438
|
+
depth_work_mode_list = self.device.get_depth_work_mode_list()
|
439
|
+
self.assertIsNotNone(depth_work_mode_list)
|
440
|
+
select_depth_work_mode = None
|
441
|
+
for i in range(depth_work_mode_list.get_count()):
|
442
|
+
depth_work_mode = depth_work_mode_list.get_depth_work_mode_by_index(i)
|
443
|
+
print("depth_work_mode: ", depth_work_mode)
|
444
|
+
if depth_work_mode != curr_depth_work_mode:
|
445
|
+
select_depth_work_mode = depth_work_mode
|
446
|
+
|
447
|
+
if select_depth_work_mode is None:
|
448
|
+
print("Not found depth work mode!")
|
449
|
+
return
|
450
|
+
self.device.set_depth_work_mode(select_depth_work_mode)
|
451
|
+
new_depth_work_mode = self.device.get_depth_work_mode()
|
452
|
+
self.assertIsNotNone(new_depth_work_mode)
|
453
|
+
self.assertEqual(new_depth_work_mode, select_depth_work_mode)
|
454
|
+
self.device.set_depth_work_mode(curr_depth_work_mode)
|
455
|
+
|
456
|
+
def test_get_and_set_fan_work_mode(self):
|
457
|
+
if not self.device.is_property_supported(OBPropertyID.OB_PROP_FAN_WORK_MODE_INT,
|
458
|
+
OBPermissionType.PERMISSION_READ_WRITE):
|
459
|
+
print("Current device not support fan work mode!")
|
460
|
+
return
|
461
|
+
curr_fan_work_mode = self.device.get_int_property(OBPropertyID.OB_PROP_FAN_WORK_MODE_INT)
|
462
|
+
self.assertIsNotNone(curr_fan_work_mode)
|
463
|
+
print("Current fan work mode: ", curr_fan_work_mode)
|
464
|
+
fan_work_mode = not curr_fan_work_mode
|
465
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_FAN_WORK_MODE_INT, fan_work_mode)
|
466
|
+
new_fan_work_mode = self.device.get_int_property(OBPropertyID.OB_PROP_FAN_WORK_MODE_INT)
|
467
|
+
self.assertIsNotNone(new_fan_work_mode)
|
468
|
+
self.assertEqual(new_fan_work_mode, fan_work_mode)
|
469
|
+
self.device.set_int_property(OBPropertyID.OB_PROP_FAN_WORK_MODE_INT, curr_fan_work_mode)
|
470
|
+
|
471
|
+
|
472
|
+
if __name__ == '__main__':
|
473
|
+
print("Start test SensorControl interface, Please make sure you have connected a device to your computer.")
|
474
|
+
unittest.main()
|
pyorbbec-1.0.1.18/MANIFEST.in
DELETED
pyorbbec-1.0.1.18/NOTICE
DELETED
pyorbbec-1.0.1.18/PKG-INFO
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: pyorbbec
|
3
|
-
Version: 1.0.1.18
|
4
|
-
Summary: Python interface to the Orbbec SDK.
|
5
|
-
Home-page: https://orbbec.com.cn/
|
6
|
-
Author: orbbec
|
7
|
-
Author-email: lijie@orbbec.com
|
8
|
-
License: Apache-2.0
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
11
|
-
Requires-Python: >=3.8
|
12
|
-
Description-Content-Type: text/markdown
|
13
|
-
License-File: LICENSE
|
14
|
-
License-File: NOTICE
|
15
|
-
Requires-Dist: pybind11==2.11.0
|
16
|
-
Requires-Dist: pybind11-global==2.11.0
|
17
|
-
Requires-Dist: opencv-python
|
18
|
-
Requires-Dist: wheel
|
19
|
-
Requires-Dist: numpy<2.0
|
20
|
-
Requires-Dist: av
|
21
|
-
Requires-Dist: pygame
|
22
|
-
Requires-Dist: pynput
|
pyorbbec-1.0.1.18/pyproject.toml
DELETED
pyorbbec-1.0.1.18/setup.py
DELETED
@@ -1,91 +0,0 @@
|
|
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 sys
|
19
|
-
import platform
|
20
|
-
import shutil
|
21
|
-
|
22
|
-
from setuptools import setup, find_packages
|
23
|
-
|
24
|
-
requires = [
|
25
|
-
'pybind11==2.11.0',
|
26
|
-
'pybind11-global==2.11.0',
|
27
|
-
'opencv-python',
|
28
|
-
'wheel',
|
29
|
-
'numpy<2.0', # see https://github.com/orbbec/pyorbbecsdk/issues/47
|
30
|
-
'av', # for h264 decoding
|
31
|
-
'pygame', # for visualization
|
32
|
-
'pynput', # for keyboard input
|
33
|
-
]
|
34
|
-
|
35
|
-
# platform tag
|
36
|
-
def get_platform_tag():
|
37
|
-
if sys.platform.startswith('win'):
|
38
|
-
return 'win_amd64'
|
39
|
-
elif sys.platform.startswith('linux'):
|
40
|
-
if sys.maxsize > 2**32 and 'aarch64' in sys.version.lower():
|
41
|
-
return 'linux_aarch64'
|
42
|
-
else:
|
43
|
-
return 'manylinux_2_17_x86_64'
|
44
|
-
else:
|
45
|
-
raise ValueError(f"Unsupported platform: {sys.platform}")
|
46
|
-
|
47
|
-
# Platform
|
48
|
-
current_platform = platform.system().lower()
|
49
|
-
|
50
|
-
# Set package data according to platform
|
51
|
-
package_data = {
|
52
|
-
'pyorbbecsdk': [],
|
53
|
-
}
|
54
|
-
|
55
|
-
# Windows
|
56
|
-
if current_platform == 'windows':
|
57
|
-
package_data['pyorbbecsdk'].extend(['win_x64/*.pyd', 'win_x64/*.dll', 'win_x64/*.lib', 'win_x64/*.xml'])
|
58
|
-
|
59
|
-
# Linux
|
60
|
-
elif current_platform == 'linux':
|
61
|
-
package_data['pyorbbecsdk'].extend(['linux_x64/*.so', 'linux_x64/*.so*', 'linux_x64/*.xml'])
|
62
|
-
|
63
|
-
setup(
|
64
|
-
name="pyorbbec",
|
65
|
-
version="1.0.1.18",
|
66
|
-
description="Python interface to the Orbbec SDK.",
|
67
|
-
long_description_content_type="text/markdown",
|
68
|
-
author="orbbec",
|
69
|
-
author_email="lijie@orbbec.com",
|
70
|
-
url="https://orbbec.com.cn/",
|
71
|
-
packages=find_packages(where="src", include=["pyorbbecsdk", "pyorbbecsdk.*"]),
|
72
|
-
package_dir={"": "src"},
|
73
|
-
options={
|
74
|
-
'bdist_wheel': {
|
75
|
-
'python_tag': 'py38',
|
76
|
-
'plat_name': get_platform_tag(),
|
77
|
-
'universal': False,
|
78
|
-
}
|
79
|
-
},
|
80
|
-
python_requires=">=3.8",
|
81
|
-
install_requires=requires,
|
82
|
-
license="Apache-2.0",
|
83
|
-
zip_safe=False,
|
84
|
-
classifiers=[
|
85
|
-
"Programming Language :: Python :: 3",
|
86
|
-
"License :: OSI Approved :: Apache Software License",
|
87
|
-
],
|
88
|
-
|
89
|
-
package_data=package_data,
|
90
|
-
include_package_data=True,
|
91
|
-
)
|
@@ -1,22 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: pyorbbec
|
3
|
-
Version: 1.0.1.18
|
4
|
-
Summary: Python interface to the Orbbec SDK.
|
5
|
-
Home-page: https://orbbec.com.cn/
|
6
|
-
Author: orbbec
|
7
|
-
Author-email: lijie@orbbec.com
|
8
|
-
License: Apache-2.0
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
11
|
-
Requires-Python: >=3.8
|
12
|
-
Description-Content-Type: text/markdown
|
13
|
-
License-File: LICENSE
|
14
|
-
License-File: NOTICE
|
15
|
-
Requires-Dist: pybind11==2.11.0
|
16
|
-
Requires-Dist: pybind11-global==2.11.0
|
17
|
-
Requires-Dist: opencv-python
|
18
|
-
Requires-Dist: wheel
|
19
|
-
Requires-Dist: numpy<2.0
|
20
|
-
Requires-Dist: av
|
21
|
-
Requires-Dist: pygame
|
22
|
-
Requires-Dist: pynput
|
@@ -1,12 +0,0 @@
|
|
1
|
-
LICENSE
|
2
|
-
MANIFEST.in
|
3
|
-
NOTICE
|
4
|
-
README.md
|
5
|
-
pyproject.toml
|
6
|
-
setup.py
|
7
|
-
src/pyorbbec.egg-info/PKG-INFO
|
8
|
-
src/pyorbbec.egg-info/SOURCES.txt
|
9
|
-
src/pyorbbec.egg-info/dependency_links.txt
|
10
|
-
src/pyorbbec.egg-info/not-zip-safe
|
11
|
-
src/pyorbbec.egg-info/requires.txt
|
12
|
-
src/pyorbbec.egg-info/top_level.txt
|
@@ -1 +0,0 @@
|
|
1
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|