def save_intrinsics(directory, file_name, intrinsics, streams):
    D = OrderedDict()
    D['cameras'] = []
    D['cameras'].append(add_camera_calibration(intrinsics['cam1'], streams))
    D['cameras'].append(add_camera_calibration(intrinsics['cam2']))
    if (not os.path.exists(directory)):
        os.mkdir(directory)
    with open((directory + file_name), 'w') as f:
        json.dump(D, f, indent=4)
        print((('Intrinsics output written to ' + directory) + file_name))
def save_intrinsics(directory, file_name, intrinsics, streams):
    D = OrderedDict()
    D['cameras'] = []
    D['cameras'].append(add_camera_calibration(intrinsics['cam1'], streams))
    D['cameras'].append(add_camera_calibration(intrinsics['cam2']))
    if (not os.path.exists(directory)):
        os.mkdir(directory)
    with open((directory + file_name), 'w') as f:
        json.dump(D, f, indent=4)
        print((('Intrinsics output written to ' + directory) + file_name))