如何使用python上的pytesseract阅读其他语言?

2024-09-27 07:28:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要用tesseract阅读僧伽罗语。我用的是centOS 7。我已经将经过训练的数据复制到/usr/share/tesseract/tessdata位置。在

我已经将经过训练的数据复制到/usr/share/tesseract/tessdata位置。在

import cv2
import numpy as np
import pytesseract
from pytesseract import image_to_string

img = cv2.imread("sinhala.png")

#crop_img = img[y1:y1+height,x1:x1+width]
text = pytesseract.image_to_string(img,lang="sin")

错误

^{pr2}$

Tags: to数据imageimportshareimgstringusr

热门问题