code: def _compute_centre_crop(
      tens: Tensor, target_size: Tuple[int, int]
  ) -> Tensor:
      _check_target_size(target_size)
  
      # Getting org height and target
      oh, ow = tens.shape[:2]
      target_w, target_h = target_size
  
      # The following line is actually the right way of accessing height and width of an opencv-specific image (height, width). However for some reason, while the code runs, this is flipped (it now becomes (width,height)). Testing needs to be done to catch this little bug
      # oh, ow = tens.shape[:2]
  
      if target_h > oh or target_w > ow:
          raise ValueError(
              "To compute centre crop, target size dimensions must be <= tens dimensions"
          )
  
      diff_h = (oh - target_h) // 2
      diff_w = (ow - target_w) // 2
  
      # tens[y:y+h, x:x+h]
      return tens[
          diff_h : diff_h + target_h, diff_w : diff_w + target_w
      ]
  
file_path: caer/caer/io/resize.py
imports: import math
  import cv2
  from ..coreten import Tensor, to_tensor
  from .._internal import _check_target_size
  from ..globals import INTER_AREA, INTER_CUBIC, INTER_NEAREST, INTER_LINEAR
  from typing import Tuple, Optional, Union
label_desc: Use image node_id 6 for calling a global function with example usage: _compute_centre_crop(tens, target_size) and returns: tens