Haar Cascades

Haar Cascades

What is Haar Cascade?

Haar cascades are algorithms that are being used to detect objects. They are very important for computer vision implementations

How do they work?

They work by extracting areas from a picture. These areas are parallel to the edges of the image and a variety of rectangle shapes can be used to capture the features of an image. They can be represented in 3 patterns:

1. Edges
2. Lines
3. Center-surrounded picture

To use a cascade in OpenCV is elementary. The only thing that is needed is an XML file with trained information.

Can I train my own cascade classifier?

According to this article, it is not possible to train a cascade classifier with OpenCV 4. OpenCV3 is needed. 

 To train a new cascade classifier, it is possible to write a python program by following the follow guide:

https://machinelearningmastery.com/using-haar-cascade-for-object-detection/

 
OpenCV provides some pretrained cascades with each release. They can be very easily downloaded here:

https://opencv.org/releases/

Download the Sources zip file and then open the data folder within the exported directory.


Sources:
1. https://machinelearningmastery.com/using-haar-cascade-for-object-detection/
2. https://medium.com/analytics-vidhya/haar-cascades-explained-38210e57970d
3. https://stackoverflow.com/questions/11537585/where-can-i-find-haar-cascades-xml-files/67897482#67897482
4. https://machinelearningmastery.com/using-haar-cascade-for-object-detection/