Provides functions for generation of the pictures. More...
Functions | |
def | takePictures |
Takes 5 photos in jpg format in intervals of 2 seconds. More... | |
def | DetectFace |
Finds faces in the photos. More... | |
def | pil2cvGrey |
Convertes photo to gray scale. More... | |
def | cv2pil |
convertes image to PIL format. More... | |
def | imgCrop |
Crops image to the given bounding box. More... | |
def | faceCrop |
Extracts the actual face and stores it. More... | |
Provides functions for generation of the pictures.
Each time, 5 photos are being taken and stored in the database. These photos are being replaced by cropped faces in gray scale color space
def training.cv2pil | ( | cv_im | ) |
convertes image to PIL format.
def training.DetectFace | ( | image, | |
faceCascade, | |||
returnImage = False |
|||
) |
Finds faces in the photos.
def training.faceCrop | ( | imagePattern, | |
boxScale = 1 |
|||
) |
Extracts the actual face and stores it.
Loads detection pattern according to the Haar Cascade principal. Detects actual face and crops the image. Stores the final image as pgm file.
def training.imgCrop | ( | image, | |
cropBox, | |||
boxScale = 1 |
|||
) |
Crops image to the given bounding box.
def training.pil2cvGrey | ( | pil_im | ) |
Convertes photo to gray scale.
def training.takePictures | ( | name | ) |
Takes 5 photos in jpg format in intervals of 2 seconds.
Creates directory with corresponding name, if not present. Stores photos in corresponding directory.