Pytesseract не видит число
Пытаюсь распознать числа с картинки, Pytesseract их не видит
Это пример обработанной картинки, в результате распознавания функция выдает пустую строку.
P.S. Добавил обрезаную картинку и код
def take_amount():
custom_config2 = r'--oem 3 --psm 10 -c tessedit_char_whitelist=0123456789'
price = Image.open(sourcepath)
cropped_price = price.crop((1082, 363, 1146, 381))
cropped_price.save("D:\\albautoorder\\source\\currentamount.png")
img = Image.open("D:\\albautoorder\\source\\currentamount.png").convert("L") # grayscale
img = img.resize((img.width * 4, img.height * 4), Image.Resampling.LANCZOS)
img = img.point(lambda x: 0 if x < 128 else 255, '1') # бинаризация
img.save("D:\\albautoorder\\source\\temp_cleaned.png")
check_price = Image.open("D:\\albautoorder\\source\\temp_cleaned.png")
num_price = pytesseract.image_to_string(check_price, config = custom_config2)
print(num_price)
return num_price.strip()
