Thursday 21 February 2013

Dataset and Program Flow

A Correction

In the Pre-Christmas Update, I said that there were 2 libraries for face recognition in OpenCV. This is incorrect, as I had glossed over the difference between face detection and face recognition.
  • Face detection finds faces in an image and this is mainly what I will be using.
  • Face recognition matches an input face against a known library of faces. I am not interested in this as much at this stage, but it could be useful in grouping photos by recognising who is in each photo, and also if I create a gallery whereby a user can click on a face and find other photos with that person in it. 

Dataset

The dataset I will be using predominately throughout the project are University of Bristol graduation photos I have taken from summer 2012. This consists of just under 2700 photographs from a weeks shooting, which has been sorted by hand into roughly 3 groups:
  • good photos to keep
  • poor photos that are not needed
  • photos which are ok, but not amazing.
An interesting area of this project is how the computed 'good photos to keep' will compare to those as determined by a human.
The photos themselves can be separated into approximately different compositions such as the following:

Full length portrait
Full length portrait
Full length landscape
Full length landscape
3/4 length portrait
3/4 length portrait
1/2 length landscape
1/2 length landscape
head and shoulders landscape
head and shoulders landscape
The size of the dataset will also help to observe how the program copes with large, real world data which is just under 10GB in size.

Program Logic Flow

To help segment the code and ensure that all the stages have been included, a basic logic flow for the program has been constructed:
  • load images
  • group images
  • for each image
    • initialise metrics
    • face detection
    • face features
    • pupil tracking
    • arms
    • feet
    • ...
    • finialse metrics
  • remove bad photos
  • select best photo
  • copy to new folder.

Dissertation

Apart from the structure of the dissertation being created, little progress has been made in the way of writing.

Thursday 7 February 2013

First Coding Day

Yesterday I started work on the coding for the project.

I had a quick look at previous OpenCV build environments in Visual Studio that I had used last year, which used a previous version of OpenCV (2.3.1). After confirming these still worked and all the linkers will still intact, I updated to the latest version 2.4.3. 

I then continued to create a new Visual Studio C++ project and created a simple C++ file that read in an image using both the C and C++ interfaces, similar to the tutorial described here. This resulted in the following:

Loading and displaying an image
Loading and displaying an image

Before finishing, I had a quick read on using the older FaceDetection library, which, as discussed in the previous post, may or may not be compatible with OpenCV 2. It turns out that it does work and using snippets of the facedetect.c file bundled with OpenCV, resulted in the following output image when used with the Haar cascade classifer:

FaceDetection with Haar Like Features
This (unedited) image is the first from the testing set I am going to use throughout the project. Details of the testing set shall be explained at a later date. As you can see, the result is not entirely accurate, but enough progress has been made on this first day.