0
votes

I am sending images through the Google Vision OCR API to obtain a text layer of the document, I have have no issues with this previously and have run it through at least a thousand times in testing. I recently delivered a POC to someone and they were reporting errors with not getting back valid text layers.

I looked and inside my JSON return I am not getting Vertices back from Google.

Here is my Request:

{
"requests": [
{
    "inputConfig': {
    "content': [tiff byte stream to string goes here],
    "mimeType': 'image/tiff"
    },
    'pages': [
    1
    ],
    'features': [
    {
        'type': 'DOCUMENT_TEXT_DETECTION'
    }
    ]
}
]
}

Here is a very small sample of what I am getting back

{
  "property": {
    "detectedLanguages": [
      {
        "languageCode": "en"
      }
    ]
  },
  "boundingBox": {
    "vertices": [
      {},
      {},
      {},
      {}
    ]
  },
  "text": "1",
  "confidence": 0.99
},
{
  "property": {
    "detectedLanguages": [
      {
        "languageCode": "en"
      }
    ]
  },
  "boundingBox": {
    "vertices": [
      {},
      {},
      {},
      {}
    ]
  },
  "text": "4",
  "confidence": 0.97
},

Thank you in advance

1
Perhaps this problem is a bug since this is not the expected behavior. I encourage you to create a public issue for GCP support (issuetracker.google.com/issues/…). Please, when filling the information, add your StackOverflow case's link. - rmesteves
Opened a defect with google, fix is pending according to them. This was not a code issue, thanks for input all! - Ben Covey

1 Answers

1
votes

Vision API uses Protocol Buffers v3

An unset primitive field has a language-defined default value.

If the X or Y value is unset, it means it is 0.