'Preprocess a 210x160x3 uint8 frame into a 6400 (80x80) (1 x input_size)
float vector.'

def preprocess(self, img):

    img = img[35:195]
    img = img[::2, ::2, 0]
    img[(img == 144)] = 0
    img[(img == 109)] = 0
    img[(img != 0)] = 1
    curr = np.expand_dims(img.astype(np.float).ravel(), axis=0)
    diff = ((curr - self.prev) if (self.prev is not None) else np.zeros((1, curr.shape[1])))
    self.prev = curr
    return diff
