Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haar Cascades vs. LBP Cascades in Face Detection [closed]

I have been experimenting with face detection in OpenCV (Open Source Computer Vision Library), and found that one could use Haar cascades to detect faces as there are several of them provided with OpenCV. However, I have noticed that there are also several LBP cascades. After doing some research, I found that LBP stands for Local Binary Patterns, and it can also be used for face detection, according to the OpenCV Face Detection Documentation.

What I would like to know is, which works better? Which one performs faster, and which one is more accurate? It seems that LBP performs faster, but I'm not 100% sure about that either. Thanks.

like image 717
Bojoeb Avatar asked Jan 09 '12 15:01

Bojoeb


People also ask

Is Haar cascade only for face detection?

Haar Cascade Detection is one of the oldest yet powerful face detection algorithms invented. It has been there since long, long before Deep Learning became famous. Haar Features were not only used to detect faces, but also for eyes, lips, license number plates etc.

What is better than Haar Cascade?

An LBP cascade can be trained to perform similarly (or better) than the Haar cascade, but out of the box, the Haar cascade is about 3x slower, and depending on your data, about 1-2% better at accurately detecting the location of a face.

Why Haar Cascade algorithm is best?

Some Haar cascade benefits are that they're very fast at computing Haar-like features due to the use of integral images (also called summed area tables). They are also very efficient for feature selection through the use of the AdaBoost algorithm.

What is Haar cascade face detection?

Haar cascade is an algorithm that can detect objects in images, irrespective of their scale in image and location. This algorithm is not so complex and can run in real-time. We can train a haar-cascade detector to detect various objects like cars, bikes, buildings, fruits, etc.


2 Answers

LBP is faster (a few times faster) but less accurate. (10-20% less than Haar).

If you want to detect faces on an embedded system, LBP is the default choice, because it does its calculations in integers.

Haar uses floats for processing, which have poorer support on embedded and mobile processors; as a result, the performance penalty is significant - big enough to make its usage on mobile phones impractical.

like image 96
Sam Avatar answered Oct 01 '22 02:10

Sam


An LBP cascade can be trained to perform similarly (or better) than the Haar cascade, but out of the box, the Haar cascade is about 3x slower, and depending on your data, about 1-2% better at accurately detecting the location of a face. This increase in accuracy is quite significant given that face detection can operate in the 95%+ accuracy range.

Below are some results when using the MUCT dataset.

A correct detection is noted when there is at least a 50% overlap between the ground-truth and OpenCV detected coordinates.

Cascade:haarcascade_frontalface_alt2.xml Datafile:muct.csv |---------------------------------------------------| |   Hits  |  Misses  | False Detects  | Multi-hit   | |  3635   |   55     |   63           |    5        | |---------------------------------------------------| Time:4m2.060s 

vs:

Cascade:lbpcascade_frontalface.xml Datafile:muct.csv |---------------------------------------------------| |   Hits  |  Misses  | False Detects  | Multi-hit   | | 3569    |  106     |   77           |    3        | |---------------------------------------------------| Time:1m12.511s 
like image 20
NoUserException Avatar answered Oct 01 '22 02:10

NoUserException