Package pycv :: Package cs :: Package cv :: Package patch :: Module frontalface :: Class FrontalFaceGenerator
[hide private]
[frames] | no frames]

Class FrontalFaceGenerator

source code

A generator that generates frontal face patches.

Instance Methods [hide private]
 
_convert_frontal_face_info_to_ObjectLocation(self, left_eye, right_eye, nose, left_mouth_corner, center_mouth_corner, right_mouth_corner)
Create an ObjectLocation representing a frontal face from its parts' locations.
source code
 
_convertWebImage2MyFaceDB(self, facedatapath) source code
 
_convertHS2MyFaceDB(self, facedatapath) source code
 
_convertBioID2MyFaceDB(self, facedatapath) source code
 
_convertARFaces2MyFaceDB(self, facedatapath) source code
 
_convertCMU2MyFaceDB(self, facedatapath) source code
 
__init__(self, database_path)
Initialize the generator.
source code
 
__del__(self) source code
 
_inc(self) source code
 
generate(self, patch, perturb_func=None, *args, **kwds)
Fill in a patch with a (perturbed) frontal face patch.
source code
Method Details [hide private]

_convert_frontal_face_info_to_ObjectLocation(self, left_eye, right_eye, nose, left_mouth_corner, center_mouth_corner, right_mouth_corner)

source code 
Create an ObjectLocation representing a frontal face from its parts' locations.
Returns:
ol: ObjectLocation
The frontal face's location.

Parameters:

From the user's view point.

left_eye : array([x,y])
The left eye's location.
right_eye: array([x,y])
The right eye's location.
nose: array([x,y])
The nose's location.
left_mouth_corner: array([x,y])
The left mouth corner's location.
center_mouth_corner: array([x,y])
The center mouth (lower) corner's location.
right_mouth_corner: array([x,y])
The right mouth corner's location.

__init__(self, database_path)
(Constructor)

source code 
Initialize the generator.
Parameters:
  • database_path (string) - the path to the folder containing the frontal face images

generate(self, patch, perturb_func=None, *args, **kwds)

source code 
Fill in a patch with a (perturbed) frontal face patch.
Parameters:
  • patch (POINTER(IplImage)) - a POINTER(IplImage) that points to a uint8 IplImage. The patch is filled after calling generate()
  • perturb_func (a function [optional]) - This function takes an ImageView corresponding to the current view that encapsulates the frontal face. You can perturb the view before it is warped to the patch. It also returns a tuple expressing the purturbed parameters. If None is given, no pertubation is made.

    Format:
    def perturb_func(iview, *args, **kwds)
    Input:
    iview: ImageView
    a view encapsulating the frontal face, to be supplied by generate()
    Output:
    perturbed_theta: tuple
    a tuple of parameters expressing how the transformation matrix is perturbed
  • other, arguments, or, keywords, - all passed to perturb_func, if it exists
Returns:
theta : a tuple/array
a vector of perturbed parameters.