code: def get_text_boundary(self, text_img):
      img_height = text_img.shape[0]
      img_width = text_img.shape[1]
      bounder = 3
      text_canny_img = cv2.Canny(text_img, 10, 20)
      edge_num_h = text_canny_img.sum(axis=0)
      no_zero_list_h = np.where(edge_num_h > 0)[0]
      edge_num_w = text_canny_img.sum(axis=1)
      no_zero_list_w = np.where(edge_num_w > 0)[0]
      if len(no_zero_list_h) == 0 or len(no_zero_list_w) == 0:
          return None
      left = max(no_zero_list_h[0] - bounder, 0)
      right = min(no_zero_list_h[-1] + bounder, img_width)
      top = max(no_zero_list_w[0] - bounder, 0)
      bottom = min(no_zero_list_w[-1] + bounder, img_height)
      return [left, right, top, bottom]
  
file_path: PaddleOCR/StyleText/engine/predictors.py
imports: import numpy
  import cv2
  import math
  import paddle
  from arch import style_text_rec
  from utils.sys_funcs import check_gpu
  from utils.logging import get_logger
label_desc: Use image node_id 8 for calling the StyleTextRecPredictor obj's underlying member method code with example usage: obj.get_text_boundary(text_img) and returns: list, None