def _bbox_crop(image, bbox):
    """Crop PIL.Image according to bbox.

    Args:
        image(PIL.Image): image to crop
        bbox(iterable): iterable with 4 elements.

    Returns:
        Cropped image.
    """

    width, height = image.size
    ratio = int(max(bbox[2], bbox[3]) * 0.75)
    center_x = int((2 * bbox[0] + bbox[2]) / 2)
    center_y = int((2 * bbox[1] + bbox[3]) / 2)
    y_low = max(0, center_y - ratio)
    y_high = min(height, center_y + ratio)
    x_low = max(0, center_x - ratio)
    x_high = min(width, center_x + ratio)
    image = image.crop([x_low, y_low, x_high, y_high])

    return image