Google Cloud Vision - Numbers and Numerals OCR
<p>I've been trying to implement an OCR program with Python that reads numbers with a specific format, XXX-XXX. I used Google's Cloud Vision API Text Recognition, but the results were unreliable. Out of 30 high-contrast 1280 x 1024 bmp images, only a handful resulted in the correct output, or at least included the correct output in the results. The program tends to omit some numbers, output in non-English languages or sneak in a few special characters.</p>

<p>The goal is to at least output the correct numbers consecutively, doesn't matter if the results are sprinkled with other junk. Is there a way to help the program recognize numbers better, for example limit the results to a specific format, or to numbers only?</p>

<p>At this moment it is not possible to add constraints or to give a specific expected number format to Vision API requests, as mentioned <a href="http://stackoverflow.com/questions/36125830/google-cloud-vision-text-detection-only-on-digits">here</a> (by the Project Manager of Cloud Vision API).</p>

<p>You can also check all the possible request parameters (in the <a href="https://cloud.google.com/vision/reference/rest/v1/images/annotate#AnnotateImageRequest" rel="nofollow">API reference</a>), none indicating anything to specify number format. Currently only options to:</p>

<ul>
<li>latLongRect: specify location of the image</li>
<li>languageHints: indicating the expected language for <code>text_detection</code> (list of supported languages <a href="https://cloud.google.com/translate/v2/translate-reference#supported_languages" rel="nofollow">here</a>)</li>
</ul>

<p>I assume you already checked out the multiple responses (with different included image regions) to see if you could reconstruct the text using the location of different digits? </p>

<p>Note that the Vision API and <code>text_detection</code> is not optimized for your data specifically, if you would have a lot of annotated data, it is also an option to actually build your own model using Tensorflow. <a href="https://matthewearl.github.io/2016/05/06/cnn-anpr/" rel="nofollow">This blogpost</a> explains a system setup to detect number plates (with a specific number format). All the code is available on <a href="https://github.com/matthewearl/deep-anpr" rel="nofollow">Github</a> and the problem seems very related to yours.</p>

python ocr google-cloud-platform google-cloud-vision text-recognition