@staticmethod
def _get_crop_offset_size(axis, points, factor):
    """Get offset and size of cropped image"""
    offset = round(points.min(axis=1)[axis] / factor)
    size = round((points.max(axis=1)[axis] - offset) / factor)
    return offset, size
