title: How do I average two points in python in OpenCV?
body: <p>I have been trying to figure out how to average 2 points in OpenCV but whenever I try something, I usually get an error involving incorrect use of tuples. I am trying to find the center point of the lines returned by cv.HoughLines2. I know that line[0] stores the (x1, y1) and line[1] stores (x2, y2) term but I do not know how to average such that I can use them in cv2.circle(). </p>
  
  <p>How do I average two points in OpenCV?</p>
  
  <pre><code>lines = cv.HoughLines2(dst, storage, cv.CV_HOUGH_PROBABILISTIC, rho, cv.CV_PI/(theta+1), thresh_1, min_len, max_dist)
  
  i = 0
  avr = 0
  for line in lines:
           #print line
  
          cv.Line(image, line[0], line[1], cv.CV_RGB(255, 0, 0), 1, 8)
          i = i+1
          avr = (line[0] + line [1])/2
  
          cv2.circle(image, avr, 4, cv.CV_RGB(0, 255, 0), 1, 8, 0)
  </code></pre>