Google OCR Drive Android

I downloaded the Android SSD for Android, the API is not well documented, so I couldn’t conclude that what I want to do is possible. I want to capture an image using a camera, converting it to black and white pdf format, and then do OCR on it to get the fields that I need as String. Do I need to send a server request, or maybe I can do this on the client side only with Drive api? sample code will be helpful.

+4
source share
2 answers

Google docs do not indicate what happens to the downloaded file when you request OCR, in particular, they do not tell you if there is an answer line.

However, a little experimentation shows that the only way to get OCR data is to search for a document after completing OCR and capturing text.

Here you will find the data structure for "Files": https://developers.google.com/drive/v2/reference/files#resource - that you will then be in the "indexableText", as a string.

Unfortunately, he will not parse any "fields". This will require an understanding of the content ... In addition, it does not capture any email addresses, which is a problem if you are trying to make business cards.

By the way, you will need to wait a while, up to 2 minutes, before the data is available. I'm not quite sure, but it may also be that the object identifier will not be available during this time, so you may need to either start a background process or do something else.

+4
source

Sorry that you did not find the documentation, it is available and available here: https://developers.google.com/drive/

All the functions of the Drive API when making server calls, see here: https://developers.google.com/drive/v2/reference/files/insert for how to perform OCR when downloading files to disk. Look at the tricky "ocr" parameter.

+4
source

Source: https://habr.com/ru/post/1482798/


All Articles