Here i've used Haar Cascade classifiers are an effective way for object detection. This method was proposed by Paul Viola and Michael Jones in their paper Rapid Object Detection using a Boosted Cascade of Simple Features . Haar Cascade is a machine learning-based approach where a lot of positive and negative images are used to train the classifier. Positive images – These images contain the images which we want our classifier to identify. Negative Images – Images of everything else, which do not contain the object we want to detect. Requirements:
Make sure you have python, Matplotlib and OpenCV installed on your pc (all the latest versions). The haar cascade files can be downloaded from the OpenCV Github repository.
Output: