Hello all.
I am trying to get OCR going for more than 1 month or so. I think I am not clear on how this stuff works.
I am stuck with this particular exception below in recognitaion module, ImageSampler.java (Copy of Sampler.Java)
My analysis:
At line,
// get and save 12 slices from last row
images = slices.get(slices.size() - 1);
I am getting Array index exception. Further analysis showed that slices.size is zero; When I drilled further that all pixels getting zero at the point
pixels[i] = pixels[i] > thr ? 1 : 0;
while doing Suovalo filtering.
Please help me out. Error stack trace is below.
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:371)
at java.util.ArrayList.get(ArrayList.java:384)
at net.sf.javaocr.demos.android.sampler.ImageSampler.acquireAndProcess(ImageSampler.java:153)
at net.sf.javaocr.demos.android.sampler.ImageSampler.main(ImageSampler.java:344)
Anonymous
I am sorry, I think this project has been discontinued.
Hi Andrea,
I'm still lurking around
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/
On Sunday, August 17, 2014 6:17 PM, Andrea De Pasquale adepasquale@users.sf.net wrote:
I am sorry, I think this project has been discontinued.
[support-requests:#6] Image slicing issue
Status: open
Group: v1.0_(example)
Created: Sat Aug 16, 2014 07:13 PM UTC by Anonymous
Last Updated: Sat Aug 16, 2014 07:13 PM UTC
Owner: Andrea De Pasquale
Hello all.
I am trying to get OCR going for more than 1 month or so. I think I am not clear on how this stuff works.
I am stuck with this particular exception below in recognitaion module, ImageSampler.java (Copy of Sampler.Java)
My analysis:
At line,
// get and save 12 slices from last row
images = slices.get(slices.size() - 1);
I am getting Array index exception. Further analysis showed that slices.size is zero; When I drilled further that all pixels getting zero at the point
pixels[i] = pixels[i] > thr ? 1 : 0;
while doing Suovalo filtering.
Please help me out. Error stack trace is below.
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:371)
at java.util.ArrayList.get(ArrayList.java:384)
at net.sf.javaocr.demos.android.sampler.ImageSampler.acquireAndProcess(ImageSampler.java:153)
at net.sf.javaocr.demos.android.sampler.ImageSampler.main(ImageSampler.java:344)
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/javaocr/support-requests/6/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Support Requests: #6
Konstantin,
I am sorry, I did not knew it. I saw this issue assigned to me and I was worried of leaving a user hanging there with no reply.
I did not write this part, but I'm looking at the code, and I see that with the SauvolaBinarisationFilter(int above, int below, Image destination, int maxValue, double weight, int window) constructor, the constructor arguments are in a different order than with the other filters' constructors. So there may be an issue with how the SauvolaBinarisationFilter class is being instantiated. I'd say you want to look at that first, especially the value of the window argument being passed into the constructor.
For future reference, when doing multiple subclasses as with the various filters, it's a good design practice to establish a list of constructor arguments which all filters require, put those at the beginning and always in the same order, then put the subclass-specific constructor arguments at the end. If the subclass-specific constructor arguments are optional, it's also good to provide an alternate constructor which defaults those values to the most-often-used values. That way, you can construct every filter with exactly the same arguments, or optionally construct a specific filter with all of that filter's arguments.
Hope that helps!
Ron