【发布时间】:2018-12-15 20:34:13
【问题描述】:
我正在使用 Google Vision API。
我想获取 google vision 找到一个单词块的矩形的顶点((x,y)位置)。到目前为止,我正在从谷歌客户端获取文本。
credentials = service_account.Credentials.from_service_account_file("/api-key.json")
client = vision.ImageAnnotatorClient(credentials=credentials)
#open file
with io.open(path, 'rb') as image_file:
content = image_file.read()
#call api
image = types.Image(content=content)
response = client.document_text_detection(image=image)
document = response.full_text_annotation
我想要的是在document.text 中获取每个单词块的顶点。
【问题讨论】: