def draw_boxes(image: np.ndarray, boxes: np.ndarray, color: tuple[int, int, int]) -> np.ndarray:
    """Draw bounding boxes on an image.

    This function draws rectangular bounding boxes on an input image using OpenCV. Each box
    is drawn with the specified color and a fixed thickness of 2 pixels.

    Args:
        image (np.ndarray): Source image on which to draw the boxes. Should be a valid
            OpenCV-compatible image array.
        boxes (np.ndarray): 2D array of shape ``(N, 4)`` where each row contains the
            ``(x1, y1, x2, y2)`` coordinates of a bounding box in pixel units. The
            coordinates specify the top-left and bottom-right corners.
        color (tuple[int, int, int]): Color of the drawn boxes in RGB format, specified
            as a tuple of 3 integers in the range ``[0, 255]``.

    Returns:
        np.ndarray: Modified image with bounding boxes drawn on top. Has the same
            dimensions and type as the input image.

    Examples:
        Draw a single red box:

        >>> import numpy as np
        >>> image = np.zeros((100, 100, 3), dtype=np.uint8)
        >>> boxes = np.array([[10, 10, 50, 50]])  # Single box
        >>> result = draw_boxes(image, boxes, color=(255, 0, 0))
        >>> result.shape
        (100, 100, 3)

        Draw multiple boxes in green:

        >>> boxes = np.array([
        ...     [20, 20, 40, 40],
        ...     [60, 60, 80, 80]
        ... ])  # Two boxes
        >>> result = draw_boxes(image, boxes, color=(0, 255, 0))

    Note:
        - Input coordinates are converted to integers before drawing
        - Boxes are drawn with a fixed thickness of 2 pixels
        - The function modifies the input image in-place
        - OpenCV uses BGR color format internally but the function expects RGB
    """
    for box in boxes:
        x_1, y_1, x_2, y_2 = box.astype(int)
        image = cv2.rectangle(image, (x_1, y_1), (x_2, y_2), color=color, thickness=2)
    return image
Draw bounding boxes on an image.

    This function draws rectangular bounding boxes on an input image using OpenCV. Each box
    is drawn with the specified color and a fixed thickness of 2 pixels.

    Args:
        image (np.ndarray): Source image on which to draw the boxes. Should be a valid
            OpenCV-compatible image array.
        boxes (np.ndarray): 2D array of shape ``(N, 4)`` where each row contains the
            ``(x1, y1, x2, y2)`` coordinates of a bounding box in pixel units. The
            coordinates specify the top-left and bottom-right corners.
        color (tuple[int, int, int]): Color of the drawn boxes in RGB format, specified
            as a tuple of 3 integers in the range ``[0, 255]``.

    Returns:
        np.ndarray: Modified image with bounding boxes drawn on top. Has the same
            dimensions and type as the input image.

    Examples:
        Draw a single red box:

        >>> import numpy as np
        >>> image = np.zeros((100, 100, 3), dtype=np.uint8)
        >>> boxes = np.array([[10, 10, 50, 50]])  # Single box
        >>> result = draw_boxes(image, boxes, color=(255, 0, 0))
        >>> result.shape
        (100, 100, 3)

        Draw multiple boxes in green:

        >>> boxes = np.array([
        ...     [20, 20, 40, 40],
        ...     [60, 60, 80, 80]
        ... ])  # Two boxes
        >>> result = draw_boxes(image, boxes, color=(0, 255, 0))

    Note:
        - Input coordinates are converted to integers before drawing
        - Boxes are drawn with a fixed thickness of 2 pixels
        - The function modifies the input image in-place
        - OpenCV uses BGR color format internally but the function expects RGB
    
src/anomalib/utils/post_processing.py