def _superimpose_segmentation_mask(metadata: dict, anomaly_map: np.ndarray, image: np.ndarray) -> np.ndarray:
        """Superimpose segmentation mask on an image.

        Args:
            metadata (dict): Image metadata containing the image dimensions.
            anomaly_map (np.ndarray): Anomaly map used to extract segmentation.
            image (np.ndarray): Image on which to superimpose the mask.

        Returns:
            np.ndarray: Image with superimposed segmentation mask.

        Example:
            >>> image = np.zeros((100, 100, 3))
            >>> anomaly_map = np.zeros((100, 100))
            >>> metadata = {"image_shape": (100, 100)}
            >>> result = Inferencer._superimpose_segmentation_mask(
            ...     metadata,
            ...     anomaly_map,
            ...     image,
            ... )
            >>> result.shape
            (100, 100, 3)
        """
        pred_mask = compute_mask(anomaly_map, 0.5)  # assumes normalized preds
        image_height = metadata["image_shape"][0]
        image_width = metadata["image_shape"][1]
        pred_mask = cv2.resize(pred_mask, (image_width, image_height))
        boundaries = find_boundaries(pred_mask)
        outlines = dilation(boundaries, np.ones((7, 7)))
        image[outlines] = [255, 0, 0]
        return image
Superimpose segmentation mask on an image.

        Args:
            metadata (dict): Image metadata containing the image dimensions.
            anomaly_map (np.ndarray): Anomaly map used to extract segmentation.
            image (np.ndarray): Image on which to superimpose the mask.

        Returns:
            np.ndarray: Image with superimposed segmentation mask.

        Example:
            >>> image = np.zeros((100, 100, 3))
            >>> anomaly_map = np.zeros((100, 100))
            >>> metadata = {"image_shape": (100, 100)}
            >>> result = Inferencer._superimpose_segmentation_mask(
            ...     metadata,
            ...     anomaly_map,
            ...     image,
            ... )
            >>> result.shape
            (100, 100, 3)
        
src/anomalib/deploy/inferencers/base_inferencer.py