title: Extract feature vector from 2d image in numpy
body: <p>I have a series of 2d images of two types, either a star or a pentagon. My aim is to classify all of these images respectively. I have 30 star images and 30 pentagon images. An example of each image is shown side by side here:</p>
  
  <p><a href="https://i.stack.imgur.com/kCTbn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kCTbn.png" alt="Sample Images"></a></p>
  
  <p>Before I apply the KNN classification algorithm, I need to extract a feature vector from all the images. The feature vectors must all be of the same size however the 2d images all vary in size. I have extracted read in my image and I get back a 2d array with zeros and ones.</p>
  
  <pre><code>image = pl.imread('imagepath.png')
  </code></pre>
  
  <p>My question is how do I process <code>image</code> in order produce a meaningful feature vector that contains enough information to allow me to do the classification. It has to be a single vector per image which I will use for training and testing.</p>