title: np.reshape(): Converting an image into a feature array based on rgb intensities
body: <p>I am trying to segment a colour image using the Mean-Shift algorithm using sklearn. 
  I have the following code:</p>
  
  <pre><code>import numpy as np
  from sklearn.cluster import MeanShift, estimate_bandwidth
  from sklearn.datasets.samples_generator import make_blobs
  import matplotlib.pyplot as plt
  from itertools import cycle
  from PIL import Image
  
  image = Image.open('sample_images/fruit_half.png')
  image = np.array(image)
  
  #need to convert image into feature array based on rgb intensities
  flat_image = np.reshape(image, [-1,3])
  </code></pre>
  
  <p>I am trying to convert the image into a feature array based on rgb intensities so that I can do the clustering. 
  However, I get the following error:</p>
  
  <pre><code>ValueError: cannot reshape array of size 3979976 into shape (3)
  </code></pre>
  
  <p>I am not sure why I am getting this error and how I can resolve this. Any insights are appreciated. </p>