add code to recognize faces with opencv
minor refactoring