def image_to_world(bbox, size):
    """Function generator to create functions for converting from image coordinates to world coordinates"""
    px_per_unit = float(size[0]) / bbox.width, float(size[1] / bbox.height)
    return lambda x, y: (x / px_per_unit[0] + bbox.xmin, (size[1] - y) /
        px_per_unit[1] + bbox.ymin)
