# 校准转储

本示例展示了如何读取并显示存储在设备上的校准数据。它从设备的 EEPROM 中获取用户校准数据和出厂校准数据，并以 JSON 格式输出。

## 类似示例

 * [校准写入](https://docs.luxonis.com/software-v3/depthai/examples/calibration/calibration_flash.md)
 * [校准加载](https://docs.luxonis.com/software-v3/depthai/examples/calibration/calibration_load.md)
 * [校准恢复出厂设置](https://docs.luxonis.com/software-v3/depthai/examples/calibration/calibration_factory_reset.md)

## 演示

显示 EEPROM 可用性检查及校准数据的脚本输出示例：

```bash
~/depthai-core/examples/python/calibration$ python3 calibration_dump.py
    Is EEPROM available: True
    User calibration: {
      "batchName": "",
      "batchTime": 1734532871,
      "boardConf": "IR-C00M00-00",
      "boardCustom": "",
      "boardName": "NG9097",
      "boardOptions": 7,
      "boardRev": "R4M2E4",
      "cameraData": [],
      "deviceName": "",
      "hardwareConf": "F1-FV01-BC001",
      "housingExtrinsics": {
        "rotationMatrix": [],
        "specTranslation": {
          "x": 0.0,
          "y": 0.0,
          "z": 0.0
        },
        "toCameraSocket": -1,
        "translation": {
          "x": 0.0,
          "y": 0.0,
          "z": 0.0
        }
      },
      "productName": "OAK-D-PRO-W-POE",
      "version": 7
      ...
    }
    Factory calibration: {
      ...
    }
```

## 设置

这个示例需要DepthAI v3 API，参见[安装说明](https://docs.luxonis.com/software-v3/depthai.md)。

## 源代码

```python
#!/usr/bin/env python3

import depthai as dai
import json

device = dai.Device(dai.UsbSpeed.HIGH)
print(f'Is EEPROM available: {device.isEepromAvailable()}')

# User calibration
try:
    print(f'User calibration: {json.dumps(device.readCalibration2().eepromToJson(), indent=2)}')
except Exception as ex:
    print(f'No user calibration: {ex}')

# Factory calibration
try:
    print(f'Factory calibration: {json.dumps(device.readFactoryCalibration().eepromToJson(), indent=2)}')
except Exception as ex:
    print(f'No factory calibration: {ex}')
```

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
