Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize digits only #5

Open
ajmakoni opened this issue Feb 15, 2014 · 5 comments
Open

Recognize digits only #5

ajmakoni opened this issue Feb 15, 2014 · 5 comments

Comments

@ajmakoni
Copy link

Hello,
I like your work. How do I get it to recognize digits only. I intend to add it to my mobile that using Sencha Touch 2 that will be required to read digits from capture images such as business cards e.t.c
Awaiting your feedback

@antimatter15
Copy link
Owner

I would just filter out the recognized letters that aren't numbers.

@rikartn
Copy link

rikartn commented Jan 11, 2015

How, specifically, would you do that? I'm fairly new to this, and sifting through 1MB of code to find that specific line of code; it would take me ages!

@antimatter15
Copy link
Owner

You could take the output and then pass it through a regex `.replace(/[^\d]/g, '')

@rikartn
Copy link

rikartn commented Jan 12, 2015

It may be that I have misunderstood the concept, but I thought that reducing the number of characters ocrad could recognize would make it more accurate. As of now, whenever I write "3", I end up with "j", "J", "_" or another character as often as "3", "1" produces "I", "6" produces "b" etc. If there was no "j", "J" og "b" in the "baseline", ocrad would not mix it up as often?

And it may be that I misunderstand what you mean on using regex.replace on the output. Do you mean ie. to manually replace all instances of "j", "J" with "3" and all instances of "b" with 6, and so on? Wouldn't reducing ocrad.js (in some way) be more effective programming?

All I (initially) want it to detect is "1234567890". Later I may want to expand to "+-*/:".

Is it possible to strip ocrad down like this in an easy way?

@antimatter15
Copy link
Owner

I've updated it to Ocrad 0.24 and built the javascript bindings for applying filters and other things. Look at examples/browser/numbers.html for how to restrict it to numeric recognition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants