【发布时间】:2020-10-22 05:56:54
【问题描述】:
我正在使用 Google Vision OCR 从 python 中的图像中提取文本。
使用以下代码 sn -p.
但是,置信度分数总是显示0.0,这绝对是不正确的。
如何从 Google 响应中提取单个字符或单词的 OCR 置信度分数?
content = cv2.imencode('.jpg', cv2.imread(file_name))[1].tostring()
img = types.Image(content=content)
response1 = client.text_detection(image=img, image_context={"language_hints": ["en"]})
response_annotations = response1.text_annotations
for x in response1.text_annotations:
print(x)
print(f'confidence:{x.confidence}')
例如:迭代的输出
description: "Date:"
bounding_poly {
vertices {
x: 127
y: 11
}
vertices {
x: 181
y: 10
}
vertices {
x: 181
y: 29
}
vertices {
x: 127
y: 30
}
}
confidence:0.0
【问题讨论】:
-
试图在演示 api 中发布图像?不同的结果?也可能删除语言提示会产生一些影响
-
演示 api?可以进一步阐述。它完美地 OCRed,甚至每个字符的大小写都正确找到了空格数。它的信心是零,不加起来
-
在这里试试 -> cloud.google.com/vision,同样的信心?
-
遇到与
google-cloud-vision==1.0.0相同的问题 -
@letsBeePolite 请问有关于这个问题的消息吗?
标签: image-processing computer-vision ocr google-cloud-vision google-vision