code: def resize_norm_img_spin(self, img):
      img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
      # return padding_im
      img = cv2.resize(img, tuple([100, 32]), cv2.INTER_CUBIC)
      img = np.array(img, np.float32)
      img = np.expand_dims(img, -1)
      img = img.transpose((2, 0, 1))
      mean = [127.5]
      std = [127.5]
      mean = np.array(mean, dtype=np.float32)
      std = np.array(std, dtype=np.float32)
      mean = np.float32(mean.reshape(1, -1))
      stdinv = 1 / np.float32(std.reshape(1, -1))
      img -= mean
      img *= stdinv
      return img
  
imports: import os
  import sys
  from PIL import Image
  import cv2
  import numpy
  import math
  import time
  import traceback
  import paddle
  import tools.infer.utility
  from ppocr.postprocess import build_post_process
  from ppocr.utils.logging import get_logger
  from ppocr.utils.utility import get_image_file_list, check_and_read
label_desc: Use image node_id 8 for calling the TextRecognizer obj's underlying member method code with example usage: obj.resize_norm_img_spin(img) and returns: img