此页面由 AI 自动翻译。查看英文原版
DepthAI
软件栈
最后更新

本页目录

  • 代码
  • 输出示例
  • RVC2
  • RVC4
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

设备信息

最后更新
Supported on:RVC2RVC4
此示例演示如何检索和显示有关已连接 DepthAI 设备的信息,包括其摄像头传感器和内部数据,例如修订号和产品名称。此示例需要 DepthAI v3 API,请参阅 安装说明。

代码

Python
1import depthai as dai
2from typing import List
3
4print('Searching for all available devices...\n')
5infos: List[dai.DeviceInfo] = dai.Device.getAllAvailableDevices()
6
7if len(infos) == 0:
8    print("Couldn't find any available devices.")
9    exit(-1)
10
11
12for info in infos:
13    # Converts enum eg. 'XLinkDeviceState.X_LINK_UNBOOTED' to 'UNBOOTED'
14    state = str(info.state).split('X_LINK_')[1]
15
16    print(f"Found device '{info.name}', DeviceID: '{info.deviceId}', State: '{state}'")
17
18
19# Connect to a specific device. We will just take the first one
20print(f"\nBooting the first available camera ({infos[0].name})...")
21with dai.Device(infos[0]) as device:
22    print("Available camera sensors: ", device.getCameraSensorNames())
23    calib = device.readCalibration()
24    eeprom = calib.getEepromData()
25    
26    print(f"Product name: {eeprom.productName}, board name {eeprom.boardName}")
27    print(f"Board revision: {eeprom.boardRev}")

输出示例

RVC2

Command Line
1Searching for all available devices...
2
3Found device '1.1', DeviceID: '18443010211F850E00', State: 'BOOTLOADER'
4
5Booting the first available camera (1.1)...
6Available camera sensors:  {<CameraBoardSocket.CAM_C: 2>: 'OV9282', <CameraBoardSocket.CAM_A: 0>: 'OV9782', <CameraBoardSocket.CAM_B: 1>: 'OV9282'}
7Product name: OAK-D-PRO-W-97, board name DM9098
8Board revision: R6M2E6

RVC4

Command Line
1Searching for all available devices...
2
3Found device '10.12.118.95', DeviceID: '3604808376', State: 'GATE'
4
5Booting the first available camera (10.12.118.95)...
6Available camera sensors:  {<CameraBoardSocket.CAM_C: 2>: 'OV9282', <CameraBoardSocket.CAM_B: 1>: 'OV9282', <CameraBoardSocket.CAM_A: 0>: 'IMX586'}
7Product name: OAK4-D, board name NG9498-ASM
8Board revision: R1