Why is LBP generaly faster than HAAR?

asked 2014-08-19 16:21:25 -0500

updated 2020-10-17 11:15:11 -0500

I am digging into Haar like and LBP features. More precisely its implementation in OpenCV. Every article or forum entry I found states, that LBP is faster than Haar. My local tests also confirm this expectation. Yet I don´t understand why are LBP faster. As far as I know, OpenCV uses MB LBP features. I looked into some trained LBP cascade, and found out that leafe values as well as stage thresholds are floating point values, similiar to Haar cascade. Also, both features are very similiar, Haar sums up regions in rectangles together to get threshold values where MB LBP does 8 thresholding with neighbours. But both alghoritms use Integral image for quick summation. So by very naive approach, it seems to me that 8 comparisions are actually slower than few additions.

So, what is the expensive part of Haar feature evaluation vs MB LBP? I know I am wrong, based on practical testing, I just don´t know why.

edit retag flag offensive close merge delete

Comments

berak: Why not? If its MB LBP, it needs to sum 9 cells of textue at specified rect offsets. Integral image makes this operation O(1). I mean, this would suggest LBP should be even slower :/

B.Gen.Jack.O.Neill gravatar imageB.Gen.Jack.O.Neill ( 2014-08-20 06:40:54 -0500 )edit

hey sorry, i was wrong, confused the lbp used in the face-reco with the one used in the cascade classifier (which indeed is using integral images).

berak gravatar imageberak ( 2014-08-20 06:54:37 -0500 )edit