Saurav Jain (Open Source + Communities)
Saurav Jain (Open Source + Communities)

@Sauain

13 Tweets 7 reads Jul 14, 2021
๐—›๐—ฎ๐—ฎ๐—ฟ ๐—–๐—ฎ๐˜€๐—ฐ๐—ฎ๐—ฑ๐—ฒ๐˜€๐Ÿ‘จโ€๐Ÿ’ป
- Arguably OpenCVโ€™s ( Open source Computer Vision ) most popular object detection algorithm.
-What is it?
-Algorithm
-Limitation
-Applications
A BIG Thread ๐Ÿงต๐Ÿ‘‡
We are living in an era, where object detection is used everywhere.
From security cameras to our mobile phones, it is used everywhere.
Haar classifiers, classifiers were used in the ๐—ณ๐—ถ๐—ฟ๐˜€๐˜ ๐—ฟ๐—ฒ๐—ฎ๐—น-๐˜๐—ถ๐—บ๐—ฒ ๐—ณ๐—ฎ๐—ฐ๐—ฒ ๐—ฑ๐—ฒ๐˜๐—ฒ๐—ฐ๐˜๐—ผ๐—ฟ.
๐—ช๐—ต๐—ฎ๐˜ ๐—ถ๐˜€ ๐—›๐—ฎ๐—ฎ๐—ฟ ๐—–๐—ฎ๐˜€๐—ฐ๐—ฎ๐—ฑ๐—ฒ โ”
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.
๐—ฃ๐—ผ๐˜€๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ถ๐—บ๐—ฎ๐—ด๐—ฒ๐˜€- These images contain the images which we want our classifier to identify
๐—ก๐—ฒ๐—ด๐—ฎ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ถ๐—บ๐—ฎ๐—ด๐—ฒ๐˜€- Everything else
๐—”๐—น๐—ด๐—ผ๐—ฟ๐—ถ๐˜๐—ต๐—บ ๐Ÿ“ฑ
The algorithm can be explained in four stages-
1โƒฃCalculating Haar Features
2โƒฃCreating Integral Images
3โƒฃUsing Adaboost
4โƒฃImplementing Cascading Classifiers
1โƒฃ ๐—–๐—ฎ๐—น๐—ฐ๐˜‚๐—น๐—ฎ๐˜๐—ถ๐—ป๐—ด ๐—›๐—ฎ๐—ฎ๐—ฟ ๐—™๐—ฒ๐—ฎ๐˜๐˜‚๐—ฟ๐—ฒ๐˜€
In easy language,
It is basically the calculation of the features we want to extract from an image.
For example, in face recognition, it can be the nose, eyes, etc.
2โƒฃ ๐—–๐—ฟ๐—ฒ๐—ฎ๐˜๐—ถ๐—ป๐—ด ๐—œ๐—ป๐˜๐—ฒ๐—ด๐—ฟ๐—ฎ๐—น ๐—œ๐—บ๐—ฎ๐—ด๐—ฒ๐˜€
So to speed up those calculations, we use integral images.
Instead of computing every pixel, it creates sub-rectangles and creates array references for each of those sub-rectangles
3โƒฃ ๐—”๐—ฑ๐—ฎ๐—ฏ๐—ผ๐—ผ๐˜€๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด
Adaboost essentially chooses the best features and trains the classifiers to use them.
It uses a combination of โ€œweak classifiersโ€ to create a โ€œstrong classifierโ€ that the algorithm can use to detect objects.
4โƒฃ ๐—œ๐—บ๐—ฝ๐—น๐—ฒ๐—บ๐—ฒ๐—ป๐˜๐—ถ๐—ป๐—ด ๐—–๐—ฎ๐˜€๐—ฐ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—–๐—น๐—ฎ๐˜€๐˜€๐—ถ๐—ณ๐—ถ๐—ฒ๐—ฟ๐˜€
The cascade classifier is made up of a series of stages, where each stage is a collection of weak learners.
Weak learners are trained using boosting, which allows for a highly accurate classifier.
๐—Ÿ๐—ถ๐—บ๐—ถ๐˜๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐Ÿšซ
Haar cascades are notoriously prone to false positives
The Viola-Jones algorithm can easily report a face in an image when no face is present.
๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ผ๐—ณ ๐—›๐—ฎ๐—ฎ๐—ฟ ๐—–๐—ฎ๐˜€๐—ฐ๐—ฎ๐—ฑ๐—ฒ๐˜€
-Autonomous Vehicles
-Facial Recognition
-Image Search
-Agriculture
-Industries
-Security
Here is my project based on Haar Cascade-
Face-Lock using OpenCV ๐Ÿ”’
๐Ÿ”— GitHub Link
github.com
Hey,
Thanks for coming to the end of the thread โค๏ธ
It was one of the longest threads by me!!
If you like my content then
- Retweet the first tweetโœ…
- Follow @sauain ๐Ÿ’ช

Loading suggestions...