'Create a shape context classifier.
* *images* - a list of input binary images where the things
to be detected are white.
* *labels* - the names of each class of objects.'

def __init__(self, images, labels):

    try:
        from sklearn import neighbors
    except:
        print 'Need    scikits    learn    installed'
    self.imgMap = {}
    self.ptMap = {}
    self.descMap = {}
    self.knnMap = {}
    self.blobCount = {}
    self.labels = labels
    self.images = images
    import warnings
    warnings.simplefilter('ignore')
    for i in range(0, len(images)):
        print ('precomputing    ' + images[i].filename)
        self.imgMap[labels[i]] = images[i]
        (pts, desc, count) = self._image2FeatureVector(images[i])
        self.blobCount[labels[i]] = count
        self.ptMap[labels[i]] = pts
        self.descMap[labels[i]] = desc
        knn = neighbors.KNeighborsClassifier()
        knn.fit(desc, range(0, len(pts)))
        self.knnMap[labels[i]] = knn
