{
"batchName": "",
"batchTime": 1757227057,
"boardConf": "IR-C11M08-00",
"boardCustom": "",
"boardName": "DM9098",
"boardOptions": 4194308,
"boardRev": "R8M2E8",
"cameraData": [
[
2,
{
"cameraType": 0,
"distortionCoeff": [
2.799251092495904,
0.6716260939427913,
-0.0009292606790813785,
-5.477695845502843e-05,
0.003735967076301709,
3.1518239198534586,
1.4786795508036454,
0.06672373306014015
],
"extrinsics": {
"rotationMatrix": [
[
0.9998781733019465,
-0.002795238196370924,
0.01532937157627293
],
[
0.0028727566664825672,
0.9999832156231199,
-0.005052575033222556
],
[
-0.015315607386243314,
0.005096428725828348,
0.9998694531009958
]
],
"specTranslation": {
"x": 3.75,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": 0,
"translation": {
"x": 3.725839212478325,
"y": -0.008956936096240872,
"z": -0.0392690996360575
}
},
"height": 800,
"intrinsicMatrix": [
[
565.3305384163488,
0.0,
642.7509867967057
],
[
0.0,
565.3305384163488,
396.23589122934396
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 0,
"specHfovDeg": 127.0,
"width": 1280,
"optimalIntrinsicMatrix": [
[
240.6043467282177,
0.0,
646.2326597286427
],
[
0.0,
244.22206771136825,
383.0966258481088
],
[
0.0,
0.0,
1.0
]
]
}
],
[
0,
{
"cameraType": 0,
"distortionCoeff": [
-8.95503192857988,
-4.793230399193805,
0.0005809288553866258,
-0.0004989531553675831,
-0.14536120776748376,
-8.620794994645994,
-7.874442069205909,
-0.9184362048530589
],
"extrinsics": {
"rotationMatrix": [
[
1.0,
0.0,
0.0
],
[
0.0,
1.0,
0.0
],
[
0.0,
0.0,
1.0
]
],
"specTranslation": {
"x": -0.0,
"y": -0.0,
"z": -0.0
},
"toCameraSocket": -1,
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"height": 800,
"intrinsicMatrix": [
[
567.1587609456845,
0.0,
640.0670781505587
],
[
0.0,
567.1587609456845,
398.92397499005335
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 120,
"specHfovDeg": 127.0,
"width": 1280,
"optimalIntrinsicMatrix": [
[
236.75777442576543,
0.0,
628.4940694412555
],
[
0.0,
235.88460062014926,
406.0294238650474
],
[
0.0,
0.0,
1.0
]
]
}
],
[
1,
{
"cameraType": 0,
"distortionCoeff": [
0.4282685360647888,
-0.07577551825903839,
-0.0009244230468966838,
0.0005704611705991254,
-0.004956465533482875,
0.7684067065691871,
-0.0292196353357294,
-0.023265921695478815
],
"extrinsics": {
"rotationMatrix": [
[
0.99968138743064,
-0.002751826837631254,
-0.025105140800384663
],
[
0.0027217431117690185,
0.9999950129132517,
-0.0012687522451802042
],
[
0.02510912762448076,
0.0011997761329195582,
0.9996840789033664
]
],
"specTranslation": {
"x": -7.5,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": 2,
"translation": {
"x": -7.4243393574910375,
"y": 0.06176783879829165,
"z": -0.09736998282568948
}
},
"height": 800,
"intrinsicMatrix": [
[
569.5027526393708,
0.0,
645.7799855433425
],
[
0.0,
569.5027526393708,
396.83445641798085
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 0,
"specHfovDeg": 127.0,
"width": 1280,
"optimalIntrinsicMatrix": [
[
251.50241999813136,
0.0,
665.3537602311195
],
[
0.0,
249.46381310177455,
385.1763173923239
],
[
0.0,
0.0,
1.0
]
]
}
]
],
"deviceName": "",
"hardwareConf": "F1-FV01-BC000",
"housingExtrinsics": {
"rotationMatrix": [
[
0.999972939491272,
-0.0029729336965829134,
0.00672992505133152
],
[
0.003010715590789914,
0.9999797344207764,
-0.005610866006463766
],
[
-0.006713107693940401,
0.005630976054817438,
0.9999616146087646
]
],
"specTranslation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": 2,
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"imuExtrinsics": {
"rotationMatrix": [
[
1.0,
0.0,
0.0
],
[
0.0,
1.0,
0.0
],
[
0.0,
0.0,
1.0
]
],
"specTranslation": {
"x": -3.794800043106079,
"y": -0.07900000363588333,
"z": 0.0
},
"toCameraSocket": 0,
"translation": {
"x": -3.794800043106079,
"y": -0.07900000363588333,
"z": 0.0
}
},
"miscellaneousData": [],
"productName": "OAK-D-PRO-W-97",
"stereoEnableDistortionCorrection": true,
"stereoRectificationData": {
"leftCameraSocket": 1,
"rectifiedRotationLeft": [
[
0.9998670951460427,
-0.011054817470414105,
-0.011982614694221622
],
[
0.0110466861960735,
0.9999387062946711,
-0.0007445655275895416
],
[
0.011990111271369753,
0.0006120983868812986,
0.9999279286864954
]
],
"rectifiedRotationRight": [
[
0.9998794123916057,
-0.008318637846210352,
0.013113387807912928
],
[
0.008309740138350521,
0.999965204960233,
0.0007328626557526302
],
[
-0.01311902794608689,
-0.0006238054365805326,
0.9999137472664965
]
],
"rightCameraSocket": 2,
"rectifiedProjectionLeft": [
[
-315.13471076111654,
0.0,
4128.294158935547,
0.0
],
[
0.0,
-315.13471076111654,
1975.6996612548828,
0.0
],
[
0.0,
0.0,
1.0,
0.0
]
],
"rectifiedProjectionRight": [
[
-315.13471076111654,
0.0,
4128.294158935547,
2339.9492048936936
],
[
0.0,
-315.13471076111654,
1975.6996612548828,
0.0
],
[
0.0,
0.0,
1.0,
0.0
]
],
"rectifiedQ": [
[
1.0,
0.0,
0.0,
-4128.294158935547
],
[
0.0,
1.0,
0.0,
-1975.6996612548828
],
[
0.0,
0.0,
0.0,
-315.13471076111654
],
[
0.0,
0.0,
0.13467587676777515,
-0.0
]
],
"validPixROILeft": [
0,
0,
0,
0
],
"validPixROIRight": [
0,
0,
0,
0
]
},
"stereoUseSpecTranslation": false,
"version": 7,
"verticalCameraSocket": -1
}
Above is json file I use for calib 1 camera. Each camera have it own file with same format but just have different value.
And below is the script I use for flash to camera
from pathlib import Path
import cv2
import depthai as dai
import argparse
import os.path as osp
cam_ids = {
'front': '19443010010DFB4800',
'left': '19443010619BFB4800',
'right': '1944301071EFFA4800'
}
calibJsonDir = "/home/emage/Documents/calib_img"
calibBackUpDir = '.'
parser = argparse.ArgumentParser()
parser.add_argument('calibJsonDir', nargs='?', help="Path to calibration file in json", default=calibJsonDir)
args = parser.parse_args()
cam_status = {
'front': False,
'left': False,
'right': False
}
for cam in list(cam_ids.keys()):
cam_id = cam_ids[cam]
choosed_id = None
found = dai.Device.getAllAvailableDevices()
for i, device_info in enumerate(found):
if cam_id == device_info.deviceId:
choosed_id = i
break
assert choosed_id is not None, f"Camera {cam} with ID {cam_id} not found"
# Select first available device
device = found[choosed_id]
print(f"Connecting to: {device_info}")
calibJsonFile = osp.join(args.calibJsonDir, cam, "result.json")
calibBackUpFile = f'{calibBackUpDir}/{cam}_calib.json'
assert osp.exists(calibJsonFile), f"Calibration file {calibJsonFile} does not exist"
# Connect device
with dai.Device(device_info) as device:
deviceCalib = device.readCalibration()
deviceCalib.eepromToJsonFile(calibBackUpFile)
print("Calibration Data on the device is backed up at:")
print(calibBackUpFile)
calibData = dai.CalibrationHandler(calibJsonFile)
print(f"Prepare to flash {calibJsonFile}")
try:
device.flashCalibration(calibData)
print('Successfully flashed calibration')
except Exception as ex:
print(f'Failed flashing calibration: {ex}')