class_docstr: Base class for geometric transformations. All geometric transformations
  need to inherit from this base class. ``GeomTransform`` unifies the class
  attributes and class functions of geometric transformations (ShearX,
  ShearY, Rotate, TranslateX, and TranslateY), and records the homography
  matrix.
  
  Required Keys:
  
  - img
  - gt_bboxes (BaseBoxes[torch.float32]) (optional)
  - gt_masks (BitmapMasks | PolygonMasks) (optional)
  - gt_seg_map (np.uint8) (optional)
  
  Modified Keys:
  
  - img
  - gt_bboxes
  - gt_masks
  - gt_seg_map
  
  Added Keys:
  
  - homography_matrix
  
  Args:
      prob (float): The probability for performing the geometric
          transformation and should be in range [0, 1]. Defaults to 1.0.
      level (int, optional): The level should be in range [0, _MAX_LEVEL].
          If level is None, it will generate from [0, _MAX_LEVEL] randomly.
          Defaults to None.
      min_mag (float): The minimum magnitude for geometric transformation.
          Defaults to 0.0.
      max_mag (float): The maximum magnitude for geometric transformation.
          Defaults to 1.0.
      reversal_prob (float): The probability that reverses the geometric
          transformation magnitude. Should be in range [0,1].
          Defaults to 0.5.
      img_border_value (int | float | tuple): The filled values for
          image border. If float, the same fill value will be used for
          all the three channels of image. If tuple, it should be 3 elements.
          Defaults to 128.
      mask_border_value (int): The fill value used for masks. Defaults to 0.
      seg_ignore_label (int): The fill value used for segmentation map.
          Note this value must equals ``ignore_label`` in ``semantic_head``
          of the corresponding config. Defaults to 255.
      interpolation (str): Interpolation method, accepted values are
          "nearest", "bilinear", "bicubic", "area", "lanczos" for 'cv2'
          backend, "nearest", "bilinear" for 'pillow' backend. Defaults
          to 'bilinear'.
docstr: Record the homography matrix for the geometric transformation.
docstr_tok: ["Record","the","homography","matrix","for","the","geometric","transformation","."]
code: def _record_homography_matrix(self, results: dict) -> None:
      """Record the homography matrix for the geometric transformation."""
      if results.get("homography_matrix", None) is None:
          results["homography_matrix"] = self.homography_matrix
      else:
          results["homography_matrix"] = (
              self.homography_matrix @ results["homography_matrix"]
          )
  
imports: from typing import Optional, Union
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms import BaseTransform
  from mmcv.transforms.utils import cache_randomness
  from mmdet.registry import TRANSFORMS
  from mmdet.structures.bbox import autocast_box_type
  from .augment_wrappers import _MAX_LEVEL, level_to_mag
label_desc: Use image node_id 7 for calling the GeomTransform obj's underlying member method code with example usage: obj._record_homography_matrix(results) without return types