To extract local binary pattern features without background
Show older comments
Hi all I detect the foreground object and all zeros fro background, the sample image is attached. So how can I only apply the LBP. The original sample and the ROI that is defined with red lines ehich I want to extract features from only this area. HOw can do that. Is there any way and any suggestion and codes. Thanks.
Answers (2)
Image Analyst
on 30 Aug 2016
0 votes
See attached demo.
7 Comments
Image Analyst
on 31 Aug 2016
The LBP is usually done on a binary image. Each of the 8 neighbors is either 1 or 0 and those can be made into a byte which is a number between 0 and 255. If you didn't have a binary image and used the original 8-bit gray levels then you'd have eight 8-bit numbers or a 64 bit pattern. You can't really deal with 64 bit numbers. You'd have to scale it down to 8 bits anyway just to visualize it on your monitor. And if you did that, the only way to do it would be to scale down each pixel value before constructing the LBP for that center pixel. It wouldn't make sense to scale down after making the LBP number. So then you're essentially back to picking a threshold like I did in the demo.
ali
on 1 Sep 2016
Image Analyst
on 1 Sep 2016
Edited: Image Analyst
on 2 Sep 2016
That looks right.
To get the histogram of only non-zero pixels, do this:
histObject = histogram(grayImage(grayImage>= 0));
Image Analyst
on 2 Sep 2016
To see what properties histObject has, set a breakpoint there and type histObject on the command line. You will see Value, BinEdges, etc.
Salma Hassan
on 7 May 2017
you mean histObject = imhist(grayImage(grayImage>= 0));
ali
on 2 Sep 2016
0 votes
2 Comments
Image Analyst
on 2 Sep 2016
I don't understand at all what this is trying to say.
ali
on 2 Sep 2016
Categories
Find more on LBP - Local Binary Patterns in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!