Hello all!
Short version:
I have the result of calibration of an Oak-D PRO W as .json file. How do I use this to update my ROS2 .yaml camera parameters?
Long version:
Here is my .json file:
{
"batchName": "",
"batchTime": 1711976057,
"boardConf": "IR-C21M08-00",
"boardCustom": "",
"boardName": "DM9098",
"boardOptions": 1048580,
"boardRev": "R8M2E8",
"cameraData": [
[
1,
{
"cameraType": 0,
"distortionCoeff": [
4.717190742492676,
1.3956365585327148,
-6.380402919603512e-05,
0.0001253595546586439,
0.023136362433433533,
5.081787586212158,
2.8329949378967285,
0.19467654824256897,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"extrinsics": {
"rotationMatrix": [
[
0.999902606010437,
0.012355554848909378,
-0.006492577493190765
],
[
-0.012324679642915726,
0.999912679195404,
0.004774123430252075
],
[
0.006550997495651245,
-0.00469363946467638,
0.9999675154685974
]
],
"specTranslation": {
"x": -7.483457565307617,
"y": 0.0403454452753067,
"z": -0.03899169713258743
},
"toCameraSocket": 2,
"translation": {
"x": -7.483457565307617,
"y": 0.0403454452753067,
"z": -0.03899169713258743
}
},
"height": 800,
"intrinsicMatrix": [
[
575.97900390625,
0.0,
617.248046875
],
[
0.0,
575.8177490234375,
399.3473205566406
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 0,
"specHfovDeg": 127.0,
"width": 1280
}
],
[
0,
{
"cameraType": 0,
"distortionCoeff": [
6.249095916748047,
24.564743041992188,
-0.00013124215183779597,
0.00021829686011187732,
1.086168885231018,
6.282415866851807,
26.701169967651367,
5.43357515335083,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"extrinsics": {
"rotationMatrix": [
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
]
],
"specTranslation": {
"x": -0.0,
"y": -0.0,
"z": -0.0
},
"toCameraSocket": -1,
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"height": 2160,
"intrinsicMatrix": [
[
2302.709228515625,
0.0,
1927.749755859375
],
[
0.0,
2302.032958984375,
1101.0440673828125
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 0,
"specHfovDeg": 108.0,
"width": 3840
}
],
[
2,
{
"cameraType": 0,
"distortionCoeff": [
0.329525351524353,
-0.025675591081380844,
3.1699910323368385e-05,
4.9789938202593476e-05,
-0.000945782579947263,
0.6532717347145081,
0.004792321473360062,
-0.006089592352509499,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"extrinsics": {
"rotationMatrix": [
[
0.9999189376831055,
-0.012608837336301804,
0.0017703291960060596
],
[
0.012609267607331276,
0.9999204874038696,
-0.00023202858574222773
],
[
-0.0017672628164291382,
0.00025433232076466084,
0.9999983906745911
]
],
"specTranslation": {
"x": 3.75,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": 0,
"translation": {
"x": 3.7869951725006104,
"y": 0.02553650178015232,
"z": -0.05815478041768074
}
},
"height": 800,
"intrinsicMatrix": [
[
559.5569458007813,
0.0,
653.0762939453125
],
[
0.0,
559.4925537109375,
366.91534423828125
],
[
0.0,
0.0,
1.0
]
],
"lensPosition": 0,
"specHfovDeg": 127.0,
"width": 1280
}
]
],
"deviceName": "",
"hardwareConf": "F1-FV01-BC000",
"housingExtrinsics": {
"rotationMatrix": [],
"specTranslation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": -1,
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"imuExtrinsics": {
"rotationMatrix": [
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
]
],
"specTranslation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"toCameraSocket": -1,
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"miscellaneousData": [],
"productName": "OAK-D-PRO-W",
"stereoEnableDistortionCorrection": true,
"stereoRectificationData": {
"leftCameraSocket": 1,
"rectifiedRotationLeft": [
[
0.9999750852584839,
0.006940091028809547,
-0.0013080642092972994
],
[
-0.0069361235946416855,
0.9999713897705078,
0.003013534704223275
],
[
0.0013289409689605236,
-0.0030043867882341146,
0.9999945759773254
]
],
"rectifiedRotationRight": [
[
0.9999639987945557,
-0.005229807924479246,
0.006683045998215675
],
[
0.005249893758445978,
0.9999817609786987,
-0.0029914637561887503
],
[
-0.006667279172688723,
0.00302644120529294,
0.9999731779098511
]
],
"rightCameraSocket": 2
},
"stereoUseSpecTranslation": false,
"version": 7,
"verticalCameraSocket": -1
}
Here is the ROS2 .yaml file for the color camera (the left and right cameras' files look the same!)
camera_matrix:
cols: 3
data: [ 1537.05322265625, 0.000000, 970.5643310546875, 0.000000, 1535.1085205078125, 509.2059020996094, 0.000000, 0.000000, 1.000000]
rows: 3
camera_name: color
distortion_coefficients:
cols: 14
data: [-1.872860, 16.683033, 0.001053, -0.002063, 61.878521, -2.158907, 18.424637,
57.682858, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000]
rows: 1
distortion_model: plumb_bob
image_height: 1080
image_width: 1920
projection_matrix:
cols: 3
data: [1479.458984, 0.000000, 950.694458, 0.0,
0.0, 1477.587158, 530.697632, 0.0,
0.0, 0.0, 1.0, 0.0]
rows: 4
rectification_matrix:
cols: 3
data: [0.9997062937394856, -0.023389961528659683, 0.006343181957754751, 0.0233922879452606,
0.999726320114537, -0.0002928052810344399, -0.006334597252184302, 0.0004411008211352551,
0.9999798389506251]
rows: 3
Any help is appreciated!