def computeFaceRecord(self,img,rect=None,eyes=None):
'''Given an image and face detection box, compute a face identification record'''
assert self.trained
img = self.cropFace(img,eyes)
vec = self.computeVector(img)
fir = self.pca.project(vec,whiten=True)
if self.measure == PCA_COS:
scale = scipy.sqrt((fir*fir).sum())
fir = (1.0/scale)*fir
return fir
评论列表
文章目录