4

I'm using Google's play-services-vision to perform Optical Character Recognition (OCR) using the TextRecognizer class on the Android platform.

In the interest of performance, I would like to limit the range of characters possible for recognition to the expected range of my application. I don't know how to go about informing the TextRecognizer of this.

Currently, I am using a very basic implementation:

TextRecognizer t = new TextRecognizer.Builder(getActivity()).build();

I'm hoping for functionality reminiscent of the following, where the TextRecognizer would only be capable of returning characters in the range of 01234abc:

t.setCharacterRange("01234abc");

If it is at all possible to define this whitelist, does anyone have any knowledge as to whether special characters can be configured for detection too?

AL.
  • 36,815
  • 10
  • 142
  • 281
Mapsy
  • 4,192
  • 1
  • 37
  • 43

1 Answers1

2

There is currently no function to whitelist only the specific characters you want to be recognized by TextRecognizer. You'll have to implement your own checker/verifier on the TextBlock String value returned.

P.S. - Yup. I also think it's a lot of work.

AL.
  • 36,815
  • 10
  • 142
  • 281
  • That's a shame. Thanks for letting me know. I assume special characters are a no-go too? – Mapsy Mar 15 '17 at 09:33
  • 1
    AFAIK, the `TextRecognizer` only recognize alphanumeric characters. Try to take a look around some other libraries, maybe there's one that suits your need. From what I've read from looking around, *Tesseract* looks promising. (See these posts: http://stackoverflow.com/a/9466477/4625829, http://stackoverflow.com/a/36453469/4625829) – AL. Mar 15 '17 at 09:38
  • Thanks a lot, I'll be sure to take a look. – Mapsy Mar 15 '17 at 09:40
  • Cool. Good luck with your app. :) – AL. Mar 15 '17 at 09:41
  • See my quesiton as well https://stackoverflow.com/q/76651691/4134215 – Taimoor Khan Jul 16 '23 at 20:15