ON THIS PAGE

  • Calibration Flash
  • Similar samples:
  • Demo
  • Setup
  • Setup
  • Source code

Calibration Flash

This example shows how to flash calibration data of version 6 (gen2 calibration data) to the device.

Similar samples:

Demo

Example script output
Command Line
1~/depthai-python/examples$ python3 Calibration/calibration_flash.py
2    Calibration Data on the device is backed up at:
3    /home/erik/Luxonis/depthai-python/examples/Calibration/depthai_calib_backup.json
4    # Calibration Flash Successful

Setup

Setup

This example requires the DepthAI v3 API, see installation instructions.

Source code

Python
C++

Python

Python
GitHub
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}')

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.