类似示例
演示
Command Line
1~/depthai-core/examples/python/calibration$ python3 calibration_flash.py path/to/calibration.json
2设备上的校准数据已备份至:
3/home/user/depthai-core/examples/python/calibration/depthai_calib_backup.json
4成功闪存校准设置
源代码
PythonGitHub
1#!/usr/bin/env python3
2
3from pathlib import Path
4import depthai as dai
5import argparse
6
7calibBackUpFile = str(
8 (Path(__file__).parent / Path("depthai_calib_backup.json")).resolve().absolute()
9)
10
11parser = argparse.ArgumentParser()
12parser.add_argument("calibJsonFile", help="Path to calibration file in json")
13args = parser.parse_args()
14
15device = dai.Device(dai.UsbSpeed.HIGH)
16deviceCalib = device.readCalibration()
17deviceCalib.eepromToJsonFile(calibBackUpFile)
18print("Calibration Data on the device is backed up at:")
19print(calibBackUpFile)
20calibData = dai.CalibrationHandler(args.calibJsonFile)
21
22try:
23 device.flashCalibration(calibData)
24 print("Successfully flashed calibration")
25except Exception as ex:
26 print(f"Failed flashing calibration: {ex}")需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。