Lessons Learned
---
I had been coding for roughly two years at this point and decided I should learn a language other than
C#. While most reasonable people would start by making Tic-Tac-Toe or something of the sort to get
acquainted with the language, I thought I should do a trial by fire, and go straight for facial recognition.
This would have been fairly simple with the numerous machine learning libraries that are available for Python,
but this was during my time as a naive programmer where I thought, "If I don't code this myself, then I'm cheating."
After quite a bit of research into how facial recognition and the various methods worked, I found the paper
"Rapid Object Detection using a Boosted Cascade of Simple Features"
which had sold me on the method (probably because of the clear steps identified in it). I spent many hours learning how to use OpenCV
and how to manipulate files and images within Python, and even longer implementing a very basic version of Haar Cascades. The culmination
of my efforts resulted in a program that took a whopping 44 seconds to process a single webcam capture. It was both exciting and disheartening.
I was so happy to see features marked by the program, but the runtime made it so impractical to test, let alone use it in any real situation.
The image input
The result of the horizontal Haar filter
... and the vertical Haar filter
This was the point where I rewrote a lot of the code. I learned about the Numpy library and converted any arrays to numpy arrays and boom 30 seconds. Limiting the size of the photo to just the face brought it to 13 seconds. Finally, I implemented integral image calculations (A fantastic explanation of integral images) , down to less than a second. This part of development was incredibly rewarding. Every change I made had very measurable effects, which fueled me in an addictive way. I began storing profiles for each person, changing the purpose of the program from a general facial recognition to one with security in mind (similar to phone locks).
In the end, because of my extreme underestimation of the amount of data I needed, not only for faces but non-faces as well, the results of the program were very unreliable. If given a face that was in memory the program would be slightly more confident it was the correct person than it would for the rest of the people, but the difference was minuscule and would often misidentify. I had a choice to make at this point on whether I wanted to continue working on the project or not and after reflecting on the purpose of the project I had started with I decided to stop working on it. I had learned a lot about facial recognition and grew confident in my ability to code in Python which was what I wanted from this .