# Where can i find a fast opencv c++ code to compute LBP and LTP histograms?

I am working on a SVM classifier to classify eye images in open or closed eye. I found this paper:

http://www.sciencedirect.com/science/...

Some of the methods described on this paper use LPB (Local Binary Pattern) and LTP (Local Ternary Pattern) as descriptors to generate the features to a SVM classifier. I know that opencv makes face recognition using LBP descriptor, but i don't know how to use it's code to get LBP histograms.

Can some one help me with this?

If someone tell me how can i use opencv LBP implementation to compute LBP histograms, or show me where can i find a fast LTP C++ code for opencv i will be grateful. If someone can tell me both will be great!

Thanks!

look e.g. here and here . openbr also has a ltp implementation

Here also, it has fast OpenCV implementation and a GPU one.

I have 3 posts on LBP, you can check it for useful infos :P, one has a LBP.cpp by bytefish and another one has histogram comparison implemented using CHI-SQR.

Thanks for sharing the useful info. I am new here.