def read_cfg_intrinsics(cfg, section, key, default):
    """
    Read intrinsics from a config file
    Args:
        cfg: config file
        section: [section] of the config file
        key: key to be read
        default: value if couldn't be read

    Returns: resulting intrinsic dict

    """
    if cfg.has_option(section, key):
        str = cfg.get(section, key).split(',')

        intinsics = {
            "x0": 320,
            "y0": 240,
            "fx": float(str[0]),
            "fy": float(str[2])
        }
        return intinsics
    else:
        return default