def add_camera_calibration(intrinsics, streams=None):
    cam = {}
    cam['center_px'] = [intrinsics.ppx, intrinsics.ppy]
    cam['focal_length_px'] = [intrinsics.fx, intrinsics.fy]
    cam['distortion'] = {}
    cam['distortion']['type'] = 'kannalabrandt4'
    cam['distortion']['k'] = intrinsics.coeffs[:4]
    if streams:
        ext = streams['cam1'].get_extrinsics_to(streams['pose'])
        cam['extrinsics'] = {}
        cam['extrinsics']['T'] = ext.translation
        cam['extrinsics']['R'] = ext.rotation
    return cam
def add_camera_calibration(intrinsics, streams=None):
    cam = {}
    cam['center_px'] = [intrinsics.ppx, intrinsics.ppy]
    cam['focal_length_px'] = [intrinsics.fx, intrinsics.fy]
    cam['distortion'] = {}
    cam['distortion']['type'] = 'kannalabrandt4'
    cam['distortion']['k'] = intrinsics.coeffs[:4]
    if streams:
        ext = streams['cam1'].get_extrinsics_to(streams['pose'])
        cam['extrinsics'] = {}
        cam['extrinsics']['T'] = ext.translation
        cam['extrinsics']['R'] = ext.rotation
    return cam