Propelled into the mainstream discourse by Apple’s iPhone X, face recognition has the potential to become a prominent feature of future web applications.
Here’s a clue from Google Trends, which shows how interest towards this subject mirrors almost exactly that towards the iPhone X:
In order to implement face recognition in our applications we need machine learning & computer vision algorithms.
The backend approach
One of the de-facto industry standards when it comes to computer vision is OpenCV. (Open Source Computer Vision Library). OpenCV is an open source computer vision and machine learning software library released under a BSD license and built in optimised C++, with bindings available for C, Python and Java.
Vincent’s opencv4nodejs package lets developers of web applications create OpenCV-powered HTTP APIs to provide browsers with the means to offload image recognition tasks to their backends.
The frontend approach
In fact, this article goes so far as to state that the days of OpenCV’s dominance are gone:
OpenCV […] supports C++, C, Python and Java interfaces. It has been designed to focus on real-time application and is widely used for sophisticated use cases (for example facial recognition).
With tracking.js, all those processings are happening on the client-side. In the browser. The days of server-side processing are gone.
Enter tracking.js, perhaps the most prominent library among those promising to get rid of server-side processing and to implement sophisticated computer vision algorithms natively into the browser.
Developed and maintained by Eduardo Lundgren, it weighs only ~7Kb and, according to its description, “enables you to do real-time color tracking, face detection and much more by using modern HTML5 specifications”
So, are the days of OpenCV really over?
I do not think so. Although perfectly capable of face detection, for example, tracking.js can’t perform advanced tasks such as face recognition (…yet). Given its rapid pace of development and just how convenient it is to be able to work within the browser, tracking.js can definitely be a worthy alternative to and deserves to be mentioned and reviewed alongside its older cousin.