title: How to add transparency to a line with OpenCV python?
body: <p>I can draw a line with OpenCV Python but I can't make the line transparent</p>
  <pre><code>def draw_from_pitch_to_image(image, reverse_output_points):
      for i in range(0, len(reverse_output_points), 2):
         x1, y1 = reverse_output_points[i]
         x2, y2 = reverse_output_points[i + 1]
  
         x1 = int(x1)
         y1 = int(y1)
         x2 = int(x2)
         y2 = int(y2)
  
         color = [255, 0, 0] if i &lt; 1 else [0, 0, 255]
         cv2.line(image, (x1, y1), (x2, y2), color, 2)
  </code></pre>
  <p>I changed the code but the line is still not transparent. I don't know why, could someone please help me to solve this problem?</p>
  <pre><code>  def draw_from_pitch_to_image(image, reverse_output_points):
        for i in range(0, len(reverse_output_points), 2):
         x1, y1 = reverse_output_points[i]
         x2, y2 = reverse_output_points[i + 1]
  
         alpha = 0.4  # Transparency factor.
         overlay = image.copy()
         x1 = int(x1)
         y1 = int(y1)
         x2 = int(x2)
         y2 = int(y2)
  
         color = [255, 0, 0] if i &lt; 1 else [0, 0, 255]
         cv2.line(overlay, (x1, y1), (x2, y2), color, 2)
         cv2.addWeighted(overlay, alpha, output, 1 - alpha, 0, output)
  </code></pre>