What are Haar Cascades?
Haar Cascade Classifiers are an effective way of detecting objects. This method was proposed by Paul Viola and Michael Jones in their article " cascade" a href = https://www.researchgate.net/publication/3940582_Rapid_Object_Detection_using_a_Boosted_Cascade_of_Simple_Features rel = noopener target = _blank> simple functions. Haar cascade — it is a machine learning approach that uses many positive and negative images to train the classifier.
- Positive images — these images contain images that we want our classifier to identify.
- Negative images — images of everything else that do not contain the object we want to detect.
- Make sure you have python, Matplotlib and OpenCV (all latest versions) installed on your machine.
- The haar cascade files can be downloaded from OpenCV Github repository .
Code: Eye Detection
Code: face and eye detection
Haar cascades can be used to detect any type of object if you have an appropriate XML file for that. You can even create your own XML files from scratch to discover any type of object you want.