【发布时间】:2020-04-28 15:33:03
【问题描述】:
我正在尝试使用 Google Cloud Vision API 分析考试表。下面是我正在使用的测试表。
Cloud Vision 可以很好地识别姓名和问题 #11 和 #12,包括笔迹。但是,它完全忽略了问题 #1 到 #9。没有数字,没有字母,什么都没有。
输出文本是"Name\nJohn\nDoe\n11\nI don\'t\nknow\nthe right\nanswer.\nfor me.\n12\nThis\nis\ntoo\ndifficult\n"。
任何想法如何强制 Cloud Vision 查看问题 #1 到 #9?
代码很简单:
def detect_document(path):
"""Detects document features in an image."""
from google.cloud import vision
import io
client = vision.ImageAnnotatorClient()
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.document_text_detection(image=image)
print (response.full_text_annotation)
detect_document('resources/scan_letters.jpg')
【问题讨论】:
标签: python-3.x google-cloud-platform google-cloud-vision