Google offers API services like text recognition and translation on its Google Cloud Platform. They can be used in ImageTrans to translate images. In this article, we are going to talk about how to set it up to use Google’s OCR and machine translation services in ImageTrans.
You need to create a Google Cloud Platform account first. You can get a $300 credits for the first year. With this amount, you can make OCR requests for 212,000 times.
Create a new project first.
Enable Cloud Vision OCR
Go to API&Services, search “OCR” and enable it.
New API Key
Create a new API key.
Fill it in ImageTrans’s preferences.
Then we can select Google as the OCR engine to use it.
Enable Cloud Translation
Similarly, we can enable cloud translation.
OCR and machine translation can share the same API key. After enabling it, we can use Google to translate texts.
Enable OCR via Google Drive
We can upload an image file to Google Drive and get its text. Compared to the Vision OCR API, this is completely free.
Enable the Drive API
Go to API&Services, search “Drive” and enable it.
Enable OAuth so that we can login our gmail account.
New OAuth screen. Choose External.
Fill in required info and add your gmail account as the test account.
Create a new OAuth client id. Select desktop application.
Download the JSON file, renamed it as
credentials.jsonand put it under ImageTrans’s foler.
Install the Plugin for ImageTrans
- Download the jar file and put it in ImageTrans’s folder: google_drive_ocr_commandline.jar. Rename it as
- Download the plugin zip and unzip it in the plugins folder: google_drive.zip
Select Google Drive as the OCR engine.
You can learn more about Google Drive OCR here.