title: Error indexing a NumPy image array in Python
body: <p>I've written a program using Python 2.7, Numpy and OpenCV to grab a photo from my webcam and give the rgb value of every pixel.  After running the code on a 640x480 pixel photo:</p>
  
  <pre><code>for x in range(638):
      for y in range(478):
          red, green, blue = image[x, y]
          print(red, green, blue)
  </code></pre>
  
  <p>I get the error message:</p>
  
  <pre><code>red, green, blue = image[x, y]
  IndexError: index 480 is out of bounds for axis 0 with size 480
  </code></pre>
  
  <p>Does anybody know why this is?</p>