def crop(image, contour):
    """Crops the image by the provided contour."""
    tl_x, tl_y = contour.tl_point
    br_x, br_y = contour.br_point

    return image[int(tl_y) : int(br_y), int(tl_x) : int(br_x)]