Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud Vision API - PDF OCR

I just tested the Google Cloud Vision API to read the text, if exist, in a image.

Until now I installed the Maven Server and the Redis Server. I just follow the instructions in this page.

https://github.com/GoogleCloudPlatform/cloud-vision/tree/master/java/text

Until now I was able to tested with .jpg files, is it possible to do it with tiff files or pdf??

I am using the following command:

java -cp target/text-1.0-SNAPSHOT-jar-with-dependencies.jar     com.google.cloud.vision.samples.text.TextApp ../../data/text/

Inside the text directory, I have the files in jpg format.

Then to read the converted file, I don't know how to do that, just I run the following command

java -cp target/text-1.0-SNAPSHOT-jar-with-dependencies.jar com.google.cloud.vision.samples.text.TextApp

And I get the message to enter a word or phrase to search in the converted files. Is there a way to see the whole document transformed?

Thanks!

like image 595
Christian Salvador Avatar asked Apr 19 '16 20:04

Christian Salvador


People also ask

Is Google Cloud Vision API free?

Pricing is tiered - the first 1000 units used each month are free, units 1001 to 5,000,000 are priced as marked, etc. If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply.

What is OCR API?

An Optical Character Recognition(OCR) API helps you transcribe text from image files and PDF documents and receive the extracted data in a JSON/CSV/Excel or other file formats.

How do I use Vision API for free?

To use the Google Vision API, you have to sign up for a Google Compute Engine Account. GCE is free to try but you will need a credit card to sign up. From there you select a project (but My First Project is selected if you have just signed up). Then get yourself an API key from the lefthand menu.


1 Answers

In 2016 PDF and TIFF formats was not supported for Cloud Vision.

The accepted formats are : (taken from the the doc)

  • JPEG
  • PNG8
  • PNG24
  • GIF
  • Animated GIF (first frame only)
  • BMP
  • WEBP
  • RAW
  • ICO

But now are added.

Docs for jpg:

https://cloud.google.com/vision/docs/ocr

Docs for pdf

https://cloud.google.com/vision/docs/pdf

like image 116
uzerzero Avatar answered Oct 19 '22 22:10

uzerzero