JFeatureLib LocalBinaryPattern

24 views
Skip to first unread message

RavenousRat

unread,
Sep 1, 2014, 6:31:36 AM9/1/14
to jfeat...@googlegroups.com
HI,

I am confused with the output of the class LocalBinaryPattern.
It says that through List<double[]> lbp = l.getFeatures(); you get
"The first two features represent the x and y coordinates of the pixel, the
remaining entries are the histograms of local binary patterns."

What I don't understand is the meaning of NumberOfHistogramBins. Why do I have to put a value > 1 to get a result? Because if I run l.setNumberOfHistogramBins(1); I get the same value for each entry. If I run l.setNumberOfHistogramBins(8); I get 8 values for each pixel. But I don't understand the meaning of these entries.

Furthermore I don't get the Priority of setNumPoints(int) versus setRadius(double).
If I set a radius of 1 then I thought that you consider 8 neighbors around the centerPixel. A radius of 1,5 consider 12 neighbors and so on. Because a radius of 2 and numPoints of 5 doesn't make sense in my opinion.

What I want to calculate is: for each pixel I want to get the binary pattern if I consider the 8 neighbors around that pixel. So one pattern for each pixel. How do I get this?

thanks for your reply.

Franz Graf

unread,
Sep 8, 2014, 3:48:00 PM9/8/14
to jfeat...@googlegroups.com
Hi,

sorry for the delayed response.
I just had to review https://en.wikipedia.org/wiki/Local_binary_patterns
for a description.
I guess you misunderstand the concept of the histogram.

The histogram just aggregates all values for the pixels within a cell.
If I get you right, you do not want to have the results aggregated into
a histogram but you want to have the single features for each pixel.

So withoug going too much into the details of the code, you might be
interested in the return value of
LocalBinaryPatterns#getBinaryPattern(x,y)
Maybe this can be achievd by a specific setting of the properties, but
it sounds as if you have a very specific use case - so it might be
easier for you to extend the class or copy the code block in order to
implement your own feature extraction logic.

Hope this helped and thanks for using JFeatureLib,

Franz


Am 01.09.2014 12:31, schrieb RavenousRat:
> HI,
>
> I am confused with the output of the class LocalBinaryPattern.
> It says that through /List<double[]> lbp = l.getFeatures();/ you get
> "The first two features represent the x and y coordinates of the pixel, the
> remaining entries are the histograms of local binary patterns."
>
> What I don't understand is the meaning of /NumberOfHistogramBins/. Why
> do I have to put a value > 1 to get a result? Because if I
> run/l.setNumberOfHistogramBins(1);/ I get the same value for each entry.
> If I run /l.setNumberOfHistogramBins(8);/ I get 8 values for each pixel.
> But I don't understand the meaning of these entries.
>
> Furthermore I don't get the Priority of /setNumPoints(int)/ versus
> /setRadius(double)/.
> If I set a radius of 1 then*I thought *that you consider 8 neighbors
> around the centerPixel. A radius of 1,5 consider 12 neighbors and so on.
> Because a radius of 2 and numPoints of 5 doesn't make sense in my opinion.
>
> *What I want to calculate is*: for each pixel I want to get the binary
> pattern if I consider the 8 neighbors around that pixel. So one pattern
> for each pixel. How do I get this?
>
> thanks for your reply.
>
> --
> You received this message because you are subscribed to the Google
> Groups "JFeatureLib" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jfeaturelib...@googlegroups.com
> <mailto:jfeaturelib...@googlegroups.com>.
> To post to this group, send email to jfeat...@googlegroups.com
> <mailto:jfeat...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Dr. Franz Graf
Homepage: http://www.Locked.de
G+: https://plus.google.com/+FranzGraf

RavenousRat

unread,
Sep 9, 2014, 3:49:47 AM9/9/14
to jfeat...@googlegroups.com, in...@locked.de
HI,

yeah, I didn't get the concept of LBP but read the original paper where the code is based on and I saw the advantage of the cells.
Besides the aggregation in the histograms was uncertain for me but now I understood.

Thanks for your reply :)
RavenousRat

Franz

unread,
Sep 10, 2014, 2:12:52 PM9/10/14
to jfeat...@googlegroups.com
Hey,

Always glad to help.
If you come across some other descriptors you want to have implemented... Just let me know.
Or even better: if you have some code.. Let me know as well

Greets
Franz

Reply all
Reply to author
Forward
0 new messages