google-cloud-vision

Google Vision API text detection Python example uses project: “google.com:cloudsdktool” and not my own project

喜你入骨 提交于 2019-12-13 02:16:38
问题 I am working on the python example for Cloud Vision API from github repo. I have already setup the project and activated the service account with its key. I have also called the gcloud auth and entered my credentials. Here is my code (as derived from the python example of Vision API text detection): import base64 import os import re import sys from googleapiclient import discovery from googleapiclient import errors import nltk from nltk.stem.snowball import EnglishStemmer from oauth2client

Special characters which are identified as individual word in google Vision OCR?

做~自己de王妃 提交于 2019-12-13 02:15:27
问题 I was trying to make the google vision OCR regex searchable. I have completed it and works pretty well when the document contains only English characters. But it fails when there is the text of other languages. It's happening because I have only English characters in google vision word component as follows. VISION_API_WORD_COUNTERS = "([a-zA-Z0-9]+)|([^a-zA-Z0-9 ])"; VISION_API_WORD_COMPONENTS = "[a-zA-Z0-9]"; VISION_API_NOT_WORD_COMPONENTS = "[^a-zA-Z0-9]"; As I can't include characters from

Google's Vision Api protobuf response object to Python dictionary

百般思念 提交于 2019-12-12 12:45:04
问题 I'm working on a project in which I need to analyze an image using Google's Vision API and post the response to a Dynamodb table. I have successfully implemented the Vision API, but not able to convert its response into Python Dictionary. Here's what I have tried: if form.is_valid(): obj = form obj.imageFile = form.cleaned_data['imageFile'] obj.textFile = form.cleaned_data['textFile'] obj.save() print(obj.imageFile) # Process the image using Google's vision API image_path = os.path.join

Google Cloud Vision API 'Request Admission Denied'

浪子不回头ぞ 提交于 2019-12-12 11:14:16
问题 I am new to Google Cloud Vision API. I am doing OCR on images primarily for bills and receipts. For a few images it is working fine, but when I try some other images it gives me this error: Error: { [Error: Request Admission Denied.] code: 400, errors: [ { message: 'Request Admission Denied.', domain: 'global', reason: 'badRequest' } ] } This is my code: // construct parameters const req = new vision.Request({ image: new vision.Image('./uploads/reciept.png'), features: [ new vision.Feature(

How to enable Google Vision API to access Google Cloud Storage Bucket within same project

孤者浪人 提交于 2019-12-12 10:55:25
问题 I have uploaded some test images to a Google Cloud Bucket, but don't want to make them public (which would be cheating). When I try to run a rest call for Google Vision API I get: { "responses": [ { "error": { "code": 7, "message": "image-annotator::User lacks permission.: Can not open file: gs://images-translate-156512/P1011234.JPG" } } ] } What are the steps to enable the Google Vision API to access Google Cloud Storage objects within the same project? At the moment I am using only the API

Google Cloud Vision API : “error code: 3” , “message”: “Bad image data.”

不问归期 提交于 2019-12-11 15:19:59
问题 I am trying to POST HTTP request to Detect Text in images converted to base64 from mat image. When I run the code, I get { "responses":[ { "error":{ "code":3, "message":"Bad image data." } } ] } My curl POST field is a JSON string like this: { "requests":[ { "image":{ "content":"lZ+elp+elp+elp+elZ+elZ6dlZ6dlZ6dlJ6dlJ2ck52ck52ck52ck52ck52bk5ybkpyakpyakpyakZuZkJqYj5m...........srW0srWzsrWzsrWzsrWz" }, "features":[ { "type":"TEXT_DETECTION" } ] } ] } I am not sure if the base64 encoded image is

Comparing device captured image with image in Google Cloud Bucket

送分小仙女□ 提交于 2019-12-11 15:17:34
问题 I would like to store a set of images on my Google Cloud Services Bucket and compare an image against that set using the Vision API. Is this possible? The closest thing I could find in my research is creating a searchable image set https://cloud.google.com/solutions/image-search-app-with-cloud-vision but I can't see how I can leverage this to do what I want. Ideal Scenario I take an image on my device, I then send that image in a json object to the vision endpoint, that image is then compared

CORS Issues with Google Vision API Calls

穿精又带淫゛_ 提交于 2019-12-11 08:54:34
问题 I am making a call to Google's Vision API using Ajax. I have completed billing and received an API key. However once implemented, I am getting errors like this: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 403." I have tried using solutions I found online like setting the request header to "Access-Control-Allow

Google longrunning operation can't map binding to any Uri template

一世执手 提交于 2019-12-11 07:38:43
问题 I attempt to implement this example https://cloud.google.com/vision/docs/pdf#vision-pdf-detection-gcs-php to get some information form a .pdf file but i get this error when the scritp make a "long polling operation" while the script wait gooogle response I attempt to get some information form a scanned pdf This is the error showed in console PS D:\www\google\Text_ORC> php pdf_detect.php Make Request. Waiting for operation to finish. PHP Fatal error: Uncaught Google\ApiCore\ValidationException

How to read one column texts with Google Cloud Vision API

蹲街弑〆低调 提交于 2019-12-11 06:59:19
问题 I have the next document image When I try to convert the image to text, the result is the next: Top Text Ref: Rad: Dte: Ddo: Ejecutivo 76520400300 Banco de Bogotá Luz Adriana Botton Text The problem is Google API recongnize it like two columns so, How can I config the Google API in order to obtain one column text? My goal is obtain: Top Text Ref:Ejecutivo Rad: 76520400300 Dte: Banco de Bogotá Ddo:Luz Adriana Botton Text 回答1: Cloud Vision API doesn't have a specific request property to specify