0
from PIL import Image
import pytesseract
import cv2
import cv2
img= cv2.imread('D:/ss.png')
pytesseract.pytesseract.tesseract_cmd="C:\Program Files (x86)\Tesseract- 
OCR\tesseract.exe'
tex = pytesseract.image_to_string(Image.open('D:/ss.png'),lang='eng')
print(pytesseract.image_to_string(Image.open('D:/ss.png'),lang='eng'))
cv2.namedWindow("input image")
cv2.imshow("Input image",img)
cv2.waitKey(0)
cv2.destroyWindow('Test')
cv2.destroyWindow('Main')

执行时显示“EOF WHILE SCANNING STRING LITERAL”

问题是什么????

4

1 回答 1

0

大概问题:

pytesseract.pytesseract.tesseract_cmd="C:\Program Files (x86)\Tesseract- 
OCR\tesseract.exe'

=>

pytesseract.pytesseract.tesseract_cmd="C:\Program Files (x86)\Tesseract- 
OCR\tesseract.exe"
于 2018-03-14T18:40:08.033 回答