code: def __call__(self, img):
      src_h, src_w = img.shape[:2]
      angle, translate, scale, shear = self.get_params(
          self.degrees, self.translate, self.scale, self.shear, src_h
      )
  
      M = self._get_inverse_affine_matrix(
          (src_w / 2, src_h / 2), angle, (0, 0), scale, shear
      )
      M = np.array(M).reshape(2, 3)
  
      startpoints = [
          (0, 0),
          (src_w - 1, 0),
          (src_w - 1, src_h - 1),
          (0, src_h - 1),
      ]
      project = lambda x, y, a, b, c: int(a * x + b * y + c)
      endpoints = [
          (project(x, y, *M[0]), project(x, y, *M[1]))
          for x, y in startpoints
      ]
  
      rect = cv2.minAreaRect(np.array(endpoints))
      bbox = cv2.boxPoints(rect).astype(dtype=np.int32)
      max_x, max_y = bbox[:, 0].max(), bbox[:, 1].max()
      min_x, min_y = bbox[:, 0].min(), bbox[:, 1].min()
  
      dst_w = int(max_x - min_x)
      dst_h = int(max_y - min_y)
      M[0, 2] += (dst_w - src_w) / 2
      M[1, 2] += (dst_h - src_h) / 2
  
      # add translate
      dst_w += int(abs(translate[0]))
      dst_h += int(abs(translate[1]))
      if translate[0] < 0:
          M[0, 2] += abs(translate[0])
      if translate[1] < 0:
          M[1, 2] += abs(translate[1])
  
      flags = get_interpolation()
      return cv2.warpAffine(
          img,
          M,
          (dst_w, dst_h),
          flags=flags,
          borderMode=cv2.BORDER_REPLICATE,
      )
  
imports: import math
  import numbers
  import random
  import cv2
  import numpy
  from paddle.vision.transforms import Compose, ColorJitter
label_desc: Use image node_id 4 for calling the CVRandomAffine obj's underlying member method code with example usage: obj.__call__(img) and returns: cv2