class_docstr: Jitter the image contents.
  
  Adapted from
  https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.6/ppocr/data/imaug/rec_img_aug.py  # noqa
  
  Required Keys:
  
  - img
  
  Modified Keys:
  
  - img
class_docstr_tok: ["Jitter","the","image","contents",".","Adapted","from","https",":","\/\/github.com\/PaddlePaddle\/PaddleOCR\/blob\/release","%","2F2.6\/ppocr\/data\/imaug\/rec_img_aug.py","#","noqa","Required","Keys",":","-","img","Modified","Keys",":","-","img"]
docstr: Transform function to jitter images.
  
  Args:
      results (dict): Result dict from loading pipeline.
      jitter_ratio (float): Controls the strength of jittering.
          Defaults to 0.01.
  
  Returns:
      dict: Jittered results.
docstr_tok: ["Transform","function","to","jitter","images",".","Args",":","results","(","dict",")",":","Result","dict","from","loading","pipeline",".","jitter_ratio","(","float",")",":","Controls","the","strength","of","jittering",".","Defaults","to","0.01",".","Returns",":","dict",":","Jittered","results","."]
code: def transform(
      self, results: Dict, jitter_ratio: float = 0.01
  ) -> Dict:
      """Transform function to jitter images.
  
      Args:
          results (dict): Result dict from loading pipeline.
          jitter_ratio (float): Controls the strength of jittering.
              Defaults to 0.01.
  
      Returns:
          dict: Jittered results.
      """
      h, w = results["img"].shape[:2]
      img = results["img"].copy()
      if h > 10 and w > 10:
          thres = min(h, w)
          jitter_range = int(random.random() * thres * 0.01)
          for i in range(jitter_range):
              img[i:, i:, :] = img[: h - i, : w - i, :]
      results["img"] = img
      return results
  
imports: import math
  import random
  from typing import Dict, List, Optional, Tuple
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms.base import BaseTransform
  from mmcv.transforms.utils import cache_randomness
  from mmocr.registry import TRANSFORMS
label_desc: Use image node_id 1 for calling the ImageContentJitter obj's underlying member method code with example usage: obj.transform(results, jitter_ratio) and returns: results