Skip to content

Recruiters README

Darien Pardinas edited this page Mar 15, 2017 · 9 revisions

In this project I demonstrate a range of software development skills that are being/were used to build this web application:

Research skills

The main problem this app solves is the automated generation of passport photos where the face of the individual is scaled and positioned as required by most standards. Most passport photo guidelines specify, among other requirements, what should be the distance between the chin and the top of the head (a.k.a. crown point) in the printed picture. For example, the Australian guidelines available here specifies that this distance should be between 32mm and 36mm. However, the direct estimation of such facial landmarks (chin and crown point) can be challenging as they can be hidden by beards or hairstyles. Therefore, I have proposed an approach to estimate them based other arguably easier to detect such as eye pupils and lips extends. Using the annotations of SCFace (a database of static images of human faces freely available for research purposes) I found that the chin and crown point can be estimated with an accuracy that is sufficient to automatically create passport photos that observe the scale and centering requirements. A more detailed report on the research is available here.

Cross-platform C++ Development

The core of this application is a C++ library that detects facial landmarks on input images using computer vision. For this aim, I have implemented a set of algorithms to detect the face location in the input image, and from there, the location of eye pupils and the lip's left and right corners. With these landmarks and a simple linear fitting model extracted from a validation training set, the crown and chin point of the face are detected and used to generate a passport photo ready to print. The implementation depends on library such as OpenCV and Poco Libraries. For unit testing and test runner Google Test/Mock is used.

Building systems and continuous integration

CMake was chosen as the main build configuration system for this project because it offers a very desirable capability: You can write your source code from within Visual Studio using the state-of-the-art code navigation/refactoring/intellisense tools such as Resharper C++ and Visual Assist and still be able to build and run in Unix based operating systems while maintaining a single build configuration system! In addition, a Python script is used to download, build from source and install third party libraries the project requires to build. Travis-CI was selected as the continuous integration server given its ability to integrate well with GitHub and being free for open-source projects.

Node.js, C++ Addon and Web API development

In order to call the C++ core library from a Node.js web application, it must be wrapped into a Node.js addon (a shared library wit .node extension). For this, some knowledge of the V8 Javascript engine, the libuv library and the asynchronous callback model used from within Node.js is required. Node.js uses node-gyp as the default build system for native C++ addons. Unfortunately node-gyp doesn't integrate with CMake, which means library dependencies are hard to resolve and must be stated explicitly in a build configuration file. For this, a thin wrapper layer was used to avoid having to link directly to OpenCV and Poco libraries.

Productivity tricks

Having the ability to debug complex code from within a sophisticated IDE is a major productivity advantage. In this project I have put in place a setup to debug the Node.js addon by invoking it with a JavaScript script from within Visual Studio. That helped significantly to troubleshoot the asynchronous code placed in libuv workers.