androidgoogle-play-servicesocrgoogle-vision

Google Play Vision: Define OCR Character Range?


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?


Solution

  • 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.