Package pyvision :: Package face :: Module PCA :: Class PCA
[hide private]
[frames] | no frames]

Class PCA

source code

FaceRecognizer.FaceRecognizer --+
                                |
                               PCA

This is a basic implementation of PCA

Instance Methods [hide private]
 
__init__(self, face_size=(128, 128), left_eye=pv.Point(32.000000,52.000000,0.000000), right_eye=pv.Point(96.000000,52.000000,0.000000), normalize=2, measure=3, whiten=True, drop_front=2, basis_vectors=100)
Crate a PCA classifier
source code
 
cropFace(self, im, eyes) source code
 
computeFaceRecord(self, img, rect=None, eyes=None)
Given an image and face detection box, compute a face identification record
source code
 
computeVector(self, img)
Creates a vector from a face
source code
 
train(self)
Train the PCA classifier
source code
 
similarity(self, fir1, fir2)
Compute the similarity of two faces
source code
 
getBasis(self) source code

Inherited from FaceRecognizer.FaceRecognizer: addTraining, distance, getTrainingMatches, getTrainingNonMatches

Method Details [hide private]

__init__(self, face_size=(128, 128), left_eye=pv.Point(32.000000,52.000000,0.000000), right_eye=pv.Point(96.000000,52.000000,0.000000), normalize=2, measure=3, whiten=True, drop_front=2, basis_vectors=100)
(Constructor)

source code 

Crate a PCA classifier

Overrides: FaceRecognizer.FaceRecognizer.__init__

computeFaceRecord(self, img, rect=None, eyes=None)

source code 

Given an image and face detection box, compute a face identification record

Parameters:
  • im - image containing the face
  • rect - specifies the location of the face in the image, and is typically defined as a detection rectangle or eye coordinates.
Returns:
data that represents the identity of the face, such as eigen coeffecients for PCA.
Overrides: FaceRecognizer.FaceRecognizer.computeFaceRecord