Main class of the whole application. Contains the core image processing functions. Takes a bunch of parameters and a list of images and tries to create a video out of it. Contains general methods, aimed at being used trough an interface.
Returns the mean size of all faces in input Used to correctly crop images
Note
Designed for internal use only
If needed, crops the image to avoid having black borders.
| Parameters: | image (IplImage) – the image to be cropped |
|---|
If needed, crops the image to avoid having black borders.
| Parameters: | image (IplImage) – the image to be cropped |
|---|
Calculates smallest output image that can be used to avoid adding black borders on image It will later be used to create the final image. The idea is the same as for :func:find_out_dims , but while avoiding black brders.
Calculates best output image size and position depending on faces found in guys. The system is simple. The output image should be as big as possible, and faces are always placed in the same position. Depending on that, the image input image is placed in the output at the correct position. Black borders are set everywhere else.
Searched for the best face size we want to have. Defined (for now), as the smallest of all found faces.
:returns int - the reference size of the bounding square for faces.
Aims at populating the guys list, using the source folder as an input. Guys list shall be sorted chronologically. .. note::In case no valid date is found, it is set to ‘’.
Creates new images, normalized by face size A reference is given in input. The idea is to get all images to have the same size in Guy.
| Parameters: | reference (int) – the reference size of the face that we want to have (0) |
|---|
Simply returns the number of guys in the current to-be movie
Note
Designed for interface use only
Displays the output image, for time ms. Setting time to 0 causes the image to remains open. Window name slightly changed to match output
| Parameters: |
|
|---|
Save all faces into out_folder, in the given image format
| Parameters: |
|---|
Creates a movie with all faces found in the inputs. Guy is skipped if no face is found.
| Parameters: |
|---|
Saves output image to the given format (given in extension)
| Parameters: |
|---|
Searches for all faces in the guys we have Results to be stored directly in guys
Takes each image one after the other, and create a guy out of it. The Face of each guy is searched. In case no face is found, a warning is returned and Guy is set to None
Class defining the interactions with the end user. Should be used as point of entry for all end users.
Inits and Configures the command line parser designed to help the user configure the application Defines all possible options, and also creats the Helper.
A new Guy is declared for each input image. A Guy should have a face, and owns the input image.
Creates output image If debug is set to true, output image is the input image with a red box around the most probable face.
Note
DEPRECATED
Creates image output, centering the face center with the required position If eq_ratio is set to something different than one, input image is scaled so that face/size = eq_ratio
| Parameters: |
|
|---|---|
| Returns: | IplImage – The ouput image, centered to fit with all other images |
This function takes a date as a string, and returns a date object. Used afterwards to sort images chronologically
| Parameters: | date (string) – The date where the image was taken |
|---|---|
| Returns: | datetime – Returns a date object according to time library. |
| Raises : | In case of error, set the date to be the current time. |
Returns True of False whether images have been found for the current image or not.
| Returns: | boolean – True if at least one face has been found |
|---|
Displays the input image, for time ms. Setting time to 0 causes the image to remains open.
| Parameters: |
|---|
This function is used to load the image when needed. To reduce memory load, only its location is saved in real time Returns an iplImage.
:returns IplImage - the input image, not modified; loaded using self.source
This function is used to load the normalized image when needed. Normalized images are used so that the face keeps the same size over time To reduce memory load, only the source image location is saved in real time Returns an iplImage.
:returns IplImage - the input image, normalized; loaded using self.source and resized afterwards
Searches for best size for intermediate image, whose face fits reference size. This method allows faces to always keep the same size during all the video. Changes the center of the image, so that the final image can be resized accordingly.
| Parameters: | reference (int) – The refence size of the face (in pixels). Defined as the first face size for now |
|---|
Returns the number of faces found for this guy
| Returns: | int – The number of faces found for the input image |
|---|
Search on the picture for a face. Populates faces list. This function is the only one containing scaling information
Set several Guy information, such as the face size, or the virtual center of the image
| Parameters: | face_params (string) – The type of file to be used to train the classifier. |
|---|
Once Faces have been found, they are listed and ordered