Exceptions in Local Binary Patterns

19 views
Skip to first unread message

Birgit

unread,
Aug 27, 2015, 3:52:08 AM8/27/15
to JFeatureLib
Hello,
I am using LocalBinaryPatterns from the library to extract texture features from my images. I noticed that not all combinations of radii and point numbers work. For example, setting the radius to 1 and the number of points to a value between 8 and 14 works, but setting the number to 16 causes an ArrayIndexOutOfBoundsException. I am not sure if this is intended behaviour or a bug. Indeed it might be not very reasonable to use a lot of points in small neighborhoods, but at least from a theoretical point of view there should be almost no limitation due to interpolation, right? Anyway, I can see that it might be reasonable to enforce a maximal number of points per neighborhood in practice. But then it would be helpful to know this maximal number to avoid exceptions being thrown. Is there any rule which allows to derive the maximal number of points possible to use depending on the chosen neighborhood size?

Thanks and best regards,

 Birgit

Franz Graf

unread,
Aug 30, 2015, 4:31:11 PM8/30/15
to jfeat...@googlegroups.com
Hi Birgit,

can you provide a small and simple test case for this so that I can
reproduce the issue?
When I try it
ByteProcessor ip = new ByteProcessor(50, 50);
LocalBinaryPatterns lbp = new LocalBinaryPatterns();
lbp.setNumPoints(16);
lbp.setRadius(1);
lbp.run(ip);

I do in deed get an Exception, yet I get an IllegalArgumentException
from the Histograms class (which I am trying to fix).

Thanks a lot
Franz
> --
> 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.
> To post to this group, send email to jfeat...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Dr. Franz Graf
Website: http://www.Locked.de
Google+: https://plus.google.com/u/0/107945158062341260943
Xing: https://www.xing.com/profile/Franz_Graf4

Franz Graf

unread,
Aug 31, 2015, 3:46:58 PM8/31/15
to jfeat...@googlegroups.com
Hey Birgit,

I located the problem. In the current implementation you may only
choose a maximum of 14 for numPoints.
I changed it to increase this limit to 30. Also there should be a
reasonable exception being thrown as soon as a param is out of range.

Can you check out the current snapshot from github and hopefully
confirm that it's working?

Cheers Franz



2015-08-27 9:52 GMT+02:00 Birgit <maf...@gmail.com>:

Birgit

unread,
Sep 1, 2015, 4:58:58 AM9/1/15
to JFeatureLib
Hi Franz,
I checked out the latest snapshot and can confirm that it works. With up to 30 points the calculation is now working, and if the specified point number is too large, an exception is thrown. Thanks for your quick response!
Cheers,

 Birgit

Franz Graf

unread,
Sep 1, 2015, 3:17:25 PM9/1/15
to jfeat...@googlegroups.com
Hey Birgit,

thanks for the quick response and for confirming that it works.

Good luck and happy extracting!
Franz
Reply all
Reply to author
Forward
0 new messages