PCA.py 文件源码

python
阅读 49 收藏 0 点赞 0 评论 0

项目:nimo 作者: wolfram2012 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号