When using pytesseract OSD, file not found error but for a seemingly random filename

Viewed 393

When I try to use pytesseract.image_to_osd() with any image and with any psm mode (I use 12 but I have tried this with the others), I get this error:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\IS\\AppData\\Local\\Temp\\tess_6f2kkuwq.osd'

Every time I run the code the missing "file" is different, but always is in the same format: tess_xxxxxxx.osd with the middle part being seemingly random.

What is going on here?

Full code:

import pytesseract
from pytesseract import Output
import cv2

img = "cn.png"

conf = r'--psm 12'

img = cv2.imread(img)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.bilateralFilter(img,9,75,75)

result = pytesseract.image_to_osd(img, config=conf, output_type=Output.DICT)

print(result)
0 Answers
Related