title: TypeError: ´numpy.uint8´ object is not iterable`
body: <p>This code shall convert my RGB-image into Black/White and provide me the RGB-value -which should be (0, 0, 0) or (255, 255, 255).</p>
  
  <pre><code>import cv2
  import numpy as np
  
  template = cv2.imread('C:\colorbars.png')
  
  gray = cv2.cvtColor(template, cv2.COLOR_RGB2GRAY)
  
  gray = cv2.resize(gray,(640,480))
  ret,gray = cv2.threshold(gray,120,255,0)
  gray2 = gray.copy()
  mask = np.zeros(gray.shape,np.uint8)
  
  contours, hier = cv2.findContours(gray,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
  for cnt in contours:
      if 200&lt;cv2.contourArea(cnt)&lt;5000:
          cv2.drawContours(gray2,[cnt],0,(0,255,0),2)
          cv2.drawContours(mask,[cnt],0,(0,255,0),-1)
  cv2.bitwise_not(gray2,gray2,mask)
  
  y = 250
  x = 200
  r, g, b = gray2[y,x]
  
  print r, g, b
  </code></pre>
  
  <p>It works if I check the RGB value of the colored image with the line <code>r, g, b = template[y,x]</code>; however as soon as I want to have the RGB value of the Black/White image, following error message appears:</p>
  
  <p><code>File "C:\Python27\Lib\site-packages\myprogram.py", Line 22, in &lt;module&gt;
  r, g, b = gray2[y,x]
  TypeError: ´numpy.uint8´ object is not iterable</code></p>
  
  <p>I assume it means that there are not enough objects in the array and I assume that the problem lies somewhere in the conversion from color to B/W.</p>