[Python] can not extract persian/farsi text from image in python using pytesseract

Discussão em 'Python' iniciado por Stack, Junho 3, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using pytesseract for extracting Persian text from the image but I get nothing! I downloaded fas.traineddata and put it in tessdata but still not working!

    here is my code

    import cv2
    import pytesseract
    from unidecode import unidecode

    pytesseract.pytesseract.tesseract_cmd = 'D:\\New folder\\tesseract.exe'
    img = cv2.imread('B.png')

    text = pytesseract.image_to_string(img , lang='fas')

    print(text)


    [​IMG]

    Continue reading...

Compartilhe esta Página