jakaskerl
 
This is the json output of:
 
device_calibration_backup_file = Path("./CALIBRATION_BACKUP_" + now + ".json")
deviceCalib = self._device.readCalibration()
deviceCalib.eepromToJsonFile(device_calibration_backup_file)
{
    "batchName": "",
    "batchTime": 0,
    "boardConf": "",
    "boardCustom": "",
    "boardName": "",
    "boardOptions": 0,
    "boardRev": "",
    "cameraData": [
        [
            3,
            {
                "cameraType": 0,
                "distortionCoeff": [
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                "extrinsics": {
                    "rotationMatrix": [
                        [
                            1.0,
                            0.0,
                            0.0
                        ],
                        [
                            0.0,
                            1.0,
                            0.0
                        ],
                        [
                            0.0,
                            0.0,
                            1.0
                        ]
                    ],
                    "specTranslation": {
                        "x": 3.2509000301361084,
                        "y": 0.0,
                        "z": 0.0
                    },
                    "toCameraSocket": 2,
                    "translation": {
                        "x": 3.2509000301361084,
                        "y": 0.0,
                        "z": 0.0
                    }
                },
                "height": 480,
                "intrinsicMatrix": [
                    [
                        550.0,
                        0.0,
                        320.0
                    ],
                    [
                        0.0,
                        550.0,
                        240.0
                    ],
                    [
                        0.0,
                        0.0,
                        1.0
                    ]
                ],
                "lensPosition": 0,
                "specHfovDeg": 0.0,
                "width": 640
            }
        ],
        [
            2,
            {
                "cameraType": 1,
                "distortionCoeff": [
                    -0.017457952722907066,
                    0.04737565293908119,
                    -0.04832303524017334,
                    0.013992629945278168,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                "extrinsics": {
                    "rotationMatrix": [
                        [
                            0.9999908804893494,
                            0.0038178323302417994,
                            -0.0019165652338415384
                        ],
                        [
                            -0.0038198132533580065,
                            0.9999921917915344,
                            -0.0010310197249054909
                        ],
                        [
                            0.0019126139814034104,
                            0.0010383311891928315,
                            0.999997615814209
                        ]
                    ],
                    "specTranslation": {
                        "x": 6.538896560668945,
                        "y": -0.017339760437607765,
                        "z": -0.021465661004185677
                    },
                    "toCameraSocket": 1,
                    "translation": {
                        "x": 6.538896560668945,
                        "y": -0.017339760437607765,
                        "z": -0.021465661004185677
                    }
                },
                "height": 1080,
                "intrinsicMatrix": [
                    [
                        534.3621215820313,
                        0.0,
                        707.8563232421875
                    ],
                    [
                        0.0,
                        532.467041015625,
                        557.4783325195313
                    ],
                    [
                        0.0,
                        0.0,
                        1.0
                    ]
                ],
                "lensPosition": 0,
                "specHfovDeg": 0.0,
                "width": 1440
            }
        ],
        [
            1,
            {
                "cameraType": 1,
                "distortionCoeff": [
                    0.0015351194888353348,
                    -0.0058898827992379665,
                    -0.0027657479513436556,
                    0.001210730872116983,
                    0.0,
                    0.0,
                    0.0,
                    0.0,
                    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": 1080,
                "intrinsicMatrix": [
                    [
                        534.84619140625,
                        0.0,
                        753.4248046875
                    ],
                    [
                        0.0,
                        532.37451171875,
                        537.838134765625
                    ],
                    [
                        0.0,
                        0.0,
                        1.0
                    ]
                ],
                "lensPosition": 0,
                "specHfovDeg": 0.0,
                "width": 1440
            }
        ]
    ],
    "deviceName": "",
    "hardwareConf": "",
    "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": "",
    "stereoEnableDistortionCorrection": false,
    "stereoRectificationData": {
        "leftCameraSocket": 2,
        "rectifiedRotationLeft": [
            [
                1.0,
                0.0,
                0.0
            ],
            [
                0.0,
                1.0,
                0.0
            ],
            [
                0.0,
                0.0,
                1.0
            ]
        ],
        "rectifiedRotationRight": [
            [
                0.9999908804893494,
                -0.0038198132533580065,
                0.0019126139814034104
            ],
            [
                0.0038178323302417994,
                0.9999921917915344,
                0.0010383311891928315
            ],
            [
                -0.0019165652338415384,
                -0.0010310197249054909,
                0.999997615814209
            ]
        ],
        "rightCameraSocket": 1
    },
    "stereoUseSpecTranslation": true,
    "version": 7,
    "verticalCameraSocket": -1
}
I'm still unsure on how to set the ToF's data in the calibration. I set this values manually, they seem to have an impact on the reprojection but I don't know how to get the real values.
 
            K[0][0] = 550  # fx
            K[1][1] = 550  # fy
            K[0][2] = 320  # cx
            K[1][2] = 240  # cy
            tof_socket = get_socket_from_name("tof", self.cam_config.name_to_socket)
            ch.setCameraIntrinsics(tof_socket, K.tolist(), (640, 480))
About undistorting the RGB before aligning, could explain more ? This is what my pipeline looks like right now
