class_docstr: Load an image from ``results['img']``.
  
  Similar with :obj:`LoadImageFromFile`, but the image has been loaded as
  :obj:`np.ndarray` in ``results['img']``. Can be used when loading image
  from webcam.
  
  Required Keys:
  
  - img
  
  Modified Keys:
  
  - img
  - img_path
  - img_shape
  - ori_shape
  
  Args:
      to_float32 (bool): Whether to convert the loaded image to a float32
          numpy array. If set to False, the loaded image is an uint8 array.
          Defaults to False.
docstr: Transform function to add image meta information.
  
  Args:
      results (dict): Result dict with Webcam read image in
          ``results['img']``.
  
  Returns:
      dict: The dict contains loaded image and meta information.
docstr_tok: ["Transform","function","to","add","image","meta","information",".","Args",":","results","(","dict",")",":","Result","dict","with","Webcam","read","image","in","``","results","[","'img","'","]","``",".","Returns",":","dict",":","The","dict","contains","loaded","image","and","meta","information","."]
code: def transform(self, results: dict) -> dict:
      """Transform function to add image meta information.
  
      Args:
          results (dict): Result dict with Webcam read image in
              ``results['img']``.
  
      Returns:
          dict: The dict contains loaded image and meta information.
      """
  
      img = results["img"]
      if self.to_float32:
          img = img.astype(np.float32)
      if self.color_type == "grayscale":
          img = mmcv.image.rgb2gray(img)
      results["img"] = img
      if results.get("img_path", None) is None:
          results["img_path"] = None
      results["img_shape"] = img.shape[:2]
      results["ori_shape"] = img.shape[:2]
      return results
  
imports: import copy
  import warnings
  from typing import Optional, Union
  import mmcv
  import mmengine.fileio
  import numpy
  from mmcv.transforms import BaseTransform
  from mmcv.transforms import LoadAnnotations
  from mmcv.transforms import LoadImageFromFile
  from mmocr.registry import TRANSFORMS
label_desc: Use image node_id 1 for calling the LoadImageFromNDArray obj's underlying member method code with example usage: obj.transform(results) and returns: results