def extract_roi(image, bounding_box):
    """Extract region of interest from image defined by bounding_box.

    Args:
        image: grayscale image as 2D numpy array of shape (height, width)
        bounding_box: (x, y, width, height) in image coordinates

    Returns:
        region of interest as 2D numpy array

    """
    (x, y, width, height) = bounding_box
    return image[y:y + height, x:x + width]