#!/usr/bin/env python
# encoding: utf-8
from PIL import Image
from numpy import *
#from pylab import *
def getVectFromImg(filename):
    img = Image.open(filename)
    img = img.convert('1')
    img.thumbnail((32,32))
    img = img.resize((32,32))
    imgbw = zeros((1, 1025))
    for i in range(32):
        for j in range(32):
            if(img.getpixel((j, i))):
                imgbw[0,32*i+j + 1] = 0
            else:
                imgbw[0,32*i+j + 1] = 1
    return imgbw












