Quickly Deploy Powerful Cross-Platform Machine Learning OCR Technology
Are you familiar with the concept of OCR? Wouldn’t it be nice to be able to easily convert images of typed, handwritten or printed text into machine-encoded text? Take a look at the two images below, with just a few lines of code we will make our Windows, Mac, Android or iOS application able to “read” those texts! Whether from a scanned document, a photo of a document or the text on signs and billboards in a landscape photo this process of extracting text from images is called Optical Character Recognition or Optical Character Reader (OCR). We can easily use Google OCR machine-learning AI in our Delphi applications The option for “Text Detection” is part of the Vision API that we can use to detect and extract information about multitple Texts in an image. For each text detected Google returns both a list of words identifed with text, bounding boxes, and textAnnotations , as well as the structural hierarchy for the OCR detected text. Google Cloud’s Vision API offers powerful pre-trained machine learning models that you can easily use on your desktop and mobile applications through REST or RPC API methods calls. Lets say you want your application to detect objects, locations, activities, animal species, products, or maybe you want not only to detect faces but also their emotions, or you may have the need to read printed or handwritten text, this and much more is possible to be done for free (up to first 1000 units/month per feature) or at very affordable prices and scalable to the use you make with no upfront commitments. How do I get my RAD Studio Delphi applications to detect text in images with an API? We can use RAD Studio and Delphi to easily setup its REST client library to take advantage of Google Cloud’s Vision API to empower our desktop and mobile applications and if the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format. Our RAD Studio and Delphi applications will be able to either call the API and perform the detection on a local image file by sending the contents of the image file as a base64 encoded string in the body of the request or rather use an image file located in Google Cloud Storage or on the Web without the need to send the contents of the image file in the body of your request. How do I set up the Google Cloud Vision Logo Detection API? Make sure you refer to Google Cloud Vision API documentation in the Text Detect section (https://cloud.google.com/vision/docs/ocr) and also Document Text Detection optimized for dense text/handwriting (https://cloud.google.com/vision/docs/pdf), but in general lines this is what you need to do on Google’s side: Visit https://cloud.google.com/vision and login with your Gmail account Create or select a Google Cloud Platform (GCP) project Enable the Vision API for that project Enable the Billing for that project Create a API Key credential How do I call Google Vision API Text Detection endpoint? Now all we need to do is to call the API URL via a HTTP POST method passing the request JSON body with type TEXT_DETECTION and source as the link to the image we want to analyze. One can do that using REST Client libraries available on […]
