title: OpenCV:src is not a numerical tuple
body: <p>I've written a program about color detection by using python. But always there's an error around the 'Erode' sentence. Here's part of my program. Thank you.</p>
  
  <pre><code># Convert the image to a Numpy array since most cv2 functions
  # require Numpy arrays.
  frame = np.array(frame, dtype=np.uint8)
  
  threshold = 0.05
  #blur the image
  frame=cv2.blur(frame, (5,5))
  #Convert from BGR to HSV
  hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
  #split into 3
  h, s, v= cv2.split(hsv)
  #red color
  s = cv2.threshold(h, 15, 1, cv2.THRESH_BINARY_INV)#1-15,x&gt;15 y=0
  h = cv2.threshold(h, 245, 1, cv2.THRESH_BINARY)#245-255 x&gt;245 y=1
  h = h + s
  kernel = cv2.getStructuringElement(cv2.MORPH_RECT,(3, 3)) 
  h = cv2.erode(h, kernel)
  v = cv2.sumElems(h)
  </code></pre>