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