douping1825 2019-05-19 04:45
浏览 1157

如何使用Google Cloud OCR进行图像到文本识别

I will highly appreciate if we can set up here a step by step working example of how to use Google Cloud API services for image to text OCR recognition. I want to get a text from an image. As far as I read: 1. You need to set up credentials to use this API which I did it and as result I had to download a file (I hided the real keys & private_key):

{
  "type": "service_account",
  "project_id": "carcheck-login",
  "private_key_id": "replace with yours",
  "private_key": "-----BEGIN PRIVATE KEY-----replace with yours
-----END PRIVATE KEY-----
",
  "client_email": "carcheck@carcheck-login.iam.gserviceaccount.com",
  "client_id": "replace with yours",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/carcheck%40carcheck-login.iam.gserviceaccount.com"
}

But from here what is next? How do I include the php or JS library and where I download it?

I found some functions and sample how to read image here: https://cloud.google.com/vision/docs/detecting-text#vision-text-detection-php but it is now clear how to use these first 2 lines:

namespace Google\Cloud\Samples\Vision;

use Google\Cloud\Vision\V1\ImageAnnotatorClient;

and where to download their libraries..

Please help to add the missing part so this can be used as a working example

Thanks for your time

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP