code: def enlargebox(box, h, w, enlarge_size, horizontal_text_bool):
      if not horizontal_text_bool:
          enlarge_size = (enlarge_size[1], enlarge_size[0])
  
      box = np.roll(box, -np.argmin(box.sum(axis=1)), axis=0)
  
      Apoint, Bpoint, Cpoint, Dpoint = box
      K1, B1 = lineBiasAndK(box[0], box[2])
      K2, B2 = lineBiasAndK(box[3], box[1])
      X = (B2 - B1) / (K1 - K2)
      Y = K1 * X + B1
      center = [X, Y]
  
      x1, y1 = sidePoint(Apoint, center, h, w, "leftTop", enlarge_size)
      x2, y2 = sidePoint(center, Bpoint, h, w, "rightTop", enlarge_size)
      x3, y3 = sidePoint(
          center, Cpoint, h, w, "rightBottom", enlarge_size
      )
      x4, y4 = sidePoint(
          Dpoint, center, h, w, "leftBottom", enlarge_size
      )
      newcharbox = np.array([[x1, y1], [x2, y2], [x3, y3], [x4, y4]])
      return newcharbox
  
imports: import math
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: enlargebox(box, h, w, enlarge_size, horizontal_text_bool) and returns: newcharbox