Skip to content

Instantly share code, notes, and snippets.

@saching13
Created April 11, 2022 17:47
Show Gist options
  • Save saching13/e457a03fb28489c801748e6ff375f3f8 to your computer and use it in GitHub Desktop.
Save saching13/e457a03fb28489c801748e6ff375f3f8 to your computer and use it in GitHub Desktop.
import numpy as np
import cv2
import depthai as dai
calibration_handler = dai.CalibrationHandler()
intrinsics = [[800, 0, 600],
[0, 800, 400],
[0, 0, 1]]
dist_coeffs = [1,2,3,4,5,0,0,0,0,0,0,0,0,0]
hfov= 120
calibration_handler.setBoardInfo("OAK-1-W", "R0M0E0")
calibration_handler.setCameraIntrinsics(dai.CameraBoardSocket.RGB, intrinsics, 1280, 800)
calibration_handler.setDistortionCoefficients(dai.CameraBoardSocket.RGB, dist_coeffs)
calibration_handler.setFov(dai.CameraBoardSocket.RGB, hfov)
device = dai.Device()
is_write_succesfull= device.flashCalibration(calibration_handler)
print("is Calibration flash successfull ?")
print(is_write_succesfull)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment