[Python] Why get nothing in output with pytesseract?

Discussão em 'Python' iniciado por Stack, Julho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I have installed language support for chi_sim:

    ls /usr/share/tesseract-ocr/5/tessdata
    chi_sim.traineddata eng.traineddata pdf.ttf
    configs osd.traineddata tessconfigs


    Please download the photo.jpeg and try with following codes: photo.jpeg

    import cv2
    from PIL import Image
    import pytesseract
    from pyocr import tesseract
    image_path = 'photo.jpeg'
    image = cv2.imread(image_path)
    image = Image.fromarray(image)
    text = pytesseract.image_to_string(image, lang='chi_sim')
    print(text)


    Why get nothing in output with above codes?

    Continue reading...

Compartilhe esta Página