Face recognition with OpenCV: Haar Cascade

Valentina Alto
DataSeries
5 min readJul 16, 2019

--

Computer vision is a field of study which aims at gaining a deep understanding from digital images or videos. Combined with AI and ML techniques, today many industries are investing in researches and solutions of computer vision. Think about the following example: many studies are being carried on to implement security cameras with object detection capabilities. Indeed, imagine a camera in a train station which, depending on the movement captured, is able to detect whether a fight is occurring: it could immediately send a signal to the closest policeman and prevent that fight from getting worse.

Object detection is a powerful instrument and, throughout this article, I’m going to explain the structure behind the algorithm we will employ, as well as provide a practical example (specifically with face detention). For this purpose, I will use OpenCV (Open Source Computer Vision Library) which is an open-source computer vision and machine learning software library and easy to import in Python. Particularly, I’m going to use the Haar Cascade algorithm.

Haar Cascade is a machine learning object detection algorithm proposed by Paul Viola and Michael Jones in their paper “Rapid Object Detection using a Boosted Cascade of Simple Features” in 2001. It is a machine learning based approach where a cascade function (I will explain this concept later on) is…

--

--

Valentina Alto
DataSeries

Data&AI Specialist at @Microsoft | MSc in Data Science | AI, Machine Learning and Running enthusiast