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