text: import numpy as np
  import cv2
  import matplotlib.pyplot as plt
  from pipeline import pipeline
  
  
  def draw_lane(original_img, binary_img, l_fit, r_fit, minv, curv_rad, center_dist):
      new_img = np.copy(original_img)
      if l_fit is None or r_fit is None:
          return original_img
      # Create an image to draw the lines on
      warp_zero = np.zeros_like(binary_img).astype(np.uint8)
      color_warp = np.dstack((warp_zero, warp_zero, warp_zero))
  
      h, w = binary_img.shape
      ploty = np.linspace(0, h - 1, num=h)  # to cover same y-range as image
      left_fitx = l_fit[0] * ploty ** 2 + l_fit[1] * ploty + l_fit[2]
      right_fitx = r_fit[0] * ploty ** 2 + r_fit[1] * ploty + r_fit[2]
  
      # Recast the x and y points into usable format for cv2.fillPoly()
      pts_left = np.array([np.transpose(np.vstack([left_fitx, ploty]))])
      pts_right = np.array([np.flipud(np.transpose(np.vstack([right_fitx, ploty])))])
      pts = np.hstack((pts_left, pts_right))
  
      # Draw the lane onto the warped blank image
      cv2.fillPoly(color_warp, np.int_([pts]), (0, 255, 0))
      cv2.polylines(color_warp, np.int32([pts_left]), isClosed=False, color=(255, 0, 255), thickness=15)
      cv2.polylines(color_warp, np.int32([pts_right]), isClosed=False, color=(0, 255, 255), thickness=15)
  
      # Warp the blank back to original image space using inverse perspective matrix (Minv)
      newwarp = cv2.warpPerspective(color_warp, minv, (w, h))
      # Combine the result with the original image
      result = cv2.addWeighted(new_img, 1, newwarp, 0.5, 0)
  
      # Add curvature info to image
      font = cv2.FONT_HERSHEY_PLAIN
      text = 'Curve radius: ' + '{:04.2f}'.format(curv_rad) + 'm'
      cv2.putText(result, text, (40, 70), font, 2.5, (200, 255, 155), 2, cv2.LINE_AA)
      direction = ''
      if center_dist > 0:
          direction = 'right'
      elif center_dist < 0:
          direction = 'left'
      abs_center_dist = abs(center_dist)
      text = '{:04.3f}'.format(abs_center_dist) + 'm ' + direction + ' of center'
      cv2.putText(result, text, (40, 120), font, 2.5, (200, 255, 155), 2, cv2.LINE_AA)
  
      return result
  