【发布时间】:2017-06-30 11:20:56
【问题描述】:
我正在使用 Google Cloud Vision Python API 执行 OCR,以便从文档中提取信息,例如身份证明。有没有办法裁剪图像,只保留文本集中的部分?我尝试使用cropHint,但它只是消除了边界。
我代码中的函数有点像:
def detect_text(path):
"""Detects text in the file."""
vision_client = vision.Client()
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = vision_client.image(content=content)
texts = image.detect_text()
【问题讨论】:
标签: python ocr google-cloud-vision