def _center_crop_compute_crop_anchor(
    crop_height: int,
    crop_width: int,
    image_height: int,
    image_width: int,
) -> tuple[int, int]:
    """Compute the anchor point for center-cropping.

    This function is a modified version of the torchvision center crop anchor
    computation that is compatible with ONNX export.

    Args:
        crop_height (int): Desired height of the crop
        crop_width (int): Desired width of the crop
        image_height (int): Height of the input image
        image_width (int): Width of the input image

    Returns:
        tuple[int, int]: Tuple containing the top and left crop anchor points
    """
    crop_top = torch.tensor((image_height - crop_height) / 2.0).round().int().item()
    crop_left = torch.tensor((image_width - crop_width) / 2.0).round().int().item()
    return crop_top, crop_left
Compute the anchor point for center-cropping.

    This function is a modified version of the torchvision center crop anchor
    computation that is compatible with ONNX export.

    Args:
        crop_height (int): Desired height of the crop
        crop_width (int): Desired width of the crop
        image_height (int): Height of the input image
        image_width (int): Width of the input image

    Returns:
        tuple[int, int]: Tuple containing the top and left crop anchor points
    
src/anomalib/data/transforms/center_crop.py