code: def get_long_fence_line(self, h, w, line):
      x1, y1, x2, y2 = line
      if x1 == x2:
          return [x1, 0, x1, h]
      if y1 == y2:
          return [0, y1, w, y1]
      k = (y2 - y1) / (x2 - x1)
      b = y1 - k * x1
  
      if k == 1 and b == 0:
          return [0, 0, w, h]
      if k == -1 and b == 0:
          return [w, 0, h, h]
  
      top = [-b / k, 0]
      left = [0, b]
      right = [w, k * w + b]
      bottom = [(h - b) / k, h]
      candidate = np.array([top, left, right, bottom])
  
      flag = np.array([0, 0, 0, 0])
  
      if top[0] >= 0 and top[0] <= w:
          flag[0] = 1
      if left[1] > 0 and left[1] <= h:
          flag[1] = 1
      if right[1] > 0 and right[1] <= h:
          flag[2] = 1
      if bottom[0] > 0 and bottom[0] < w:
          flag[3] = 1
  
      ind = np.where(flag == 1)
      candidate = candidate[ind]
      candidate_sort = candidate[candidate[:, 1].argsort()]
  
      return [
          int(candidate_sort[0][0]),
          int(candidate_sort[0][1]),
          int(candidate_sort[1][0]),
          int(candidate_sort[1][1]),
      ]
  
file_path: PaddleDetection/deploy/pipeline/ppvehicle/vehicle_retrograde.py
imports: import numpy
  import math
label_desc: Use image node_id 7 for calling the VehicleRetrogradeRecognizer obj's underlying member method code with example usage: obj.get_long_fence_line(h, w, line) and returns: list, list, list, list, list