我有 2 个英特尔实感 D415。我正在使用带有 Xubuntu 16.04 和 python 3.5.2 的 NUC。 我只能找到此文档和示例:https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python
我的问题是我需要通过序列号选择要使用的相机,以确保每次都选择相同的相机。
import pyrealsense2 as rs
pipeline = rs.pipeline()
config = rs.config()
profile = config.resolve(pipeline)
profile = config.resolve(pipeline)
print(profile.get_device())
此代码打印:< pyrealsense2.device: Intel RealSense D415 (S/N: 805212060066) >
我需要检查 S/N,以防它不正确,我需要传递给第二台相机,然后是第三台....
我需要有关 pyrealsense2 的指南或文档,但我认为它不存在
编辑 - 我找到了解决方案:
import pyrealsense2 as rs
ctx = rs.context()
if len(ctx.devices) > 0:
for d in ctx.devices:
print ('Found device: ', \
d.get_info(rs.camera_info.name), ' ', \
d.get_info(rs.camera_info.serial_number))
else:
print("No Intel Device connected")
最佳答案
您可以在配置中指定设备序列号。
config = re.config()
config.enable_device('805212060066')
profile = config.resolve(pipeline)
关于python - Pyrealsense2 (Librealsense SDK 2.0) : choose cam from Serial Number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50724909/