File Exchange

image thumbnail

Efficient LLBP (Line Local Binary Pattern)

version 1.1.0.0 (446 KB) by Nikolay S.
The function implements LLBP (Line Local Binary Pattern)

9 Downloads

Updated 22 Aug 2015

View License

Description
The LLBP tests the relation between pixel and its neighbors, encoding this relation into a binary word. This allows detection of patterns/features. The current version uses horizontal and vertical shaped filter, resulting in "line" shape, for which the name is given.
An illustration of Line LBP can be seen here: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3251987/figure/f6-sensors-11-11357/
While this shape implies options for specific efficient 1D filter based implementation, here I implemented it via wrapping of my "efficientLBP" function- which achieves not optimal, but reasonable run-time. And I like code reuse :)

Comments and Ratings (23)

Hi Nikolay,
I have reviewed some papers on LBP but I am still not clear. We divide image into blocks of 3*3 and for each block compute LBP with 8 neighbouring pixels right? For each block we obtain LBP or that pattern is for central pixel ?

Nikolay S.

Hi dewi hastuti
I try to document my functions so you I will quote the documentetion:
nFiltDims- a 2 elements integer vector, defining vertical and horizontal filter dimensions.

Best regards,
Nikolay

Hi Nikolay,

I want to ask what's nFiltDims it? nFiltDims is image size?

Thanks!
Dewi

Nikolay S.

Hi Santosh Shrikhande.
It seems like you want to apply LBP to an LLBP data. Frankly speaking I have not tried it myself, so i encourage you to search for relevant papers... the usage of LBP is briefly explained in the help section of the submission, and the submission documentation http://www.mathworks.com/matlabcentral/fileexchange/36484-local-binary-patterns
Best regards,
NIkolay

Can we use LBP histogram to reduce the feature matrix of LLBP? Then how use LBP histogram please explain me

Nikolay S.

Hi Ben.
You can find horizontal and vertical lines in an image easily via LLBP, but this by far not the optimal method.
Other lines can also be detected, but again, I think LLBP is not the right tool. Consider Hought transform and edge detection methods.
Best regards,
Nikolay

Ben Kang

Hi Nikolay,

I want to find lines in images, how the LLBP be most effectively used?

Thanks!
Ben

Nikolay S.

Good morning Ari.
You propose an interesting question. The LBP can be applied to 1D sound input (though I have seen this investigated so far). Perhaps someone has used this method for sound classification.
Anyways, LLBP will compare current signal with previous and future samples, an decode it to binary value. A series of such binaries values, will describe the original signal in some way, and may be used for classification. But one must define the filter (number of used neighbors), and find a way to use the LBP values for classifications. This sounds like an interesting project.
I'd suggest modifying LLBP code- using only one vertical pair of filters.
Best regards,
Nikolay

Ari Kuncoro

Hi Nikolay,

Is it possible to use this LLBP feature extraction for sound signal? How?

Thanks!
Ari

Nikolay S.

Hi noo no.
I propose only a conversion to feature space. I will briefly answer your question, but I urge you to learn the topic, as it is a large topic to cover.
To perform detection you need a classifier.
To perform detection performance analysis you will need a database including relevant positive and negative samples, divided to independent Train and Test groups. Train is used to train the classifier, while test classification/detection results are the ones used to measure detector accuracy, sensitivity, specificity etc... I personally prefer using ROC curves as a measure of detector performance.
Hope this short explanation is useful.
Best regards,
Nikolay

noo no

Hi nikolay S
how training and testing local binary pattern code and calculate accuracy?

Nikolay S.

Hi Santosh.
If I got your question correctly, the image edges problem which you refer to is usually solved in one of the following:
1) Extrapolate the image across borders n some way:
1.a) Assume image is zero out of the image
1.b) Mirror reflection of the image across the borders. I personally prefer this one
1.c) Assume periodic image- thus apply modulus on image coordinates. When across the border,s tart over from 1.
2) Use only internal/valid part of the image.- that is crop the image suffering from borders effect.

You can see this well explained and used in imfilter function options section: http://www.mathworks.com/help/images/ref/imfilter.html?searchHighlight=imfilter#inputarg_options

I suggest emailing me with question out of cope of submitted file, rather then using the comments and rating section of the submission.

Best regards.
Nikolay

Hi Nikolay..
I want to ask regarding local line binary pattern algorithm. The neighbourhood is line shaped in LLBP, then how to move this line shaped mask over an image so that it would be on each and every pixel. If the length of line is 13 pixels then how to place this line mask over each and every pixel to move on the last pixel. Because if the mask is on last pixel then 12 locations will be ahead of an image size. Please explain this.
Thank you.

Hi Nikolay..
I want to ask regarding local line binary pattern algorithm. The neighbourhood is line shaped in LLBP, then how to move this line shaped mask over an image so that it would be on each and every pixel. If the length of line is 13 pixels then how to place this line mast over each and every pixel to move on the last pixel. Please just clear me this.
Thank you.

Nikolay S.

Hi there Santosh. I can try helping you. What is the problem in hand?

Thanks a lot Nikolay S.
Actually am working on my base paper "Local Directional Code". I have partially implemented this paper but am facing some problem. Can u help me. The paper link is https://www.mdpi.com/1424-8220/12/11/14937/pdf

Nikolay S.

Hi again Santosh Shrikhande.
You should not user RAW LBP. A commonly used option is to use LBP histogram, which limits the feature vector to length on number of histogram elements, regardless of used pixels neighborhood area. This feature vector can further be reduced via PCA or in an easier manner you can try identify most significant features, and use only them. That's it, in a few words...

ya..its true but unique description of each pixel for creation of feature vector becomes too long size of feature vector. In testing step number of comparison of will be more. so is any statistical features can be extracted from the LBP image so that length of feature vector will be short.

Nikolay S.

Hi there Santosh Shrikhande.
A feature vector is a hopefuly unique description of a pixel, or a pixel and it's neighborhood. A good point to start, is to use pixel's and it's N-by-N surroundings LBP to form a feature vector, via sliding window (matlab blocproc function can be handy). Then once the feature vector is ready you can try detection/segmentation ect... to isolate regions of interest.
Hope this helps

Thank for providing the code. But how to form the feature vector from the LBP and LLBP code of an image. I want to use this for biometrics application, so feature vector of input and test image should be compared.

Nikolay S.

You're wellcome

jayanti

Thank you Nikolay :D

Updates

1.1.0.0

Minor bug fixes

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Local binary patterns