【发布时间】:2020-08-05 00:08:58
【问题描述】:
我是 tensorflow 的新手,所以我对 tensorflow 有点困惑,有多个模型可以像执行 OCR 一样
- attention_ocr
- 街道
我有以下文件,我必须执行 OCR。我尝试使用pytesseract 读取图像但没有给出正确的结果。
我需要上图的以下结果
D MANIKANDAN
DURAISAMY
16/07/1986
BNZPM2501F
请建议我 tensorflow 模态对于执行上述 OCR 很有用。我正在使用下面的代码从pytesseract获取数据
def getData(coordinate, image):
(y1, y2, x1, x2, classification) = coordinate
ts = int(time.time())
height = y2-y1
width = x2-x1
crop = image[y1:y1+height, x1:x1+width]
CROP_IMAGE_URL = EXPORT_PATH +"data.jpg"
cv2.imwrite(CROP_IMAGE_URL, crop)
img = cv2.imread(CROP_IMAGE_URL)
text = pytesseract.image_to_string(img)
os.remove(CROP_IMAGE_URL)
return text
【问题讨论】:
-
投反对票的人请评论投反对票的原因。
-
我没有投反对票,但我想你也应该发布代码(到目前为止你已经尝试过)
-
您在哪里遇到检测文本的问题,对吗?如果是,则通过选择
psm和oem值来配置您的 pytessearch
标签: python python-3.x tensorflow tensorflow2.0 tensorflow-datasets