Skip to content

Error while performing OCR on image #55

Closed
@jorgeflorez

Description

Hello,
I am using the following code in order to perform OCR on an image (attached):

from tesserocr import PyTessBaseAPI
from PIL import Image

DEFAULT_LANGUAGE = "spa"
filePath = "/home/jorge/Desktop/prueba_tess/c1.png"

if __name__ == '__main__':
    img = Image.open(filePath)
    tesseract = PyTessBaseAPI(lang=DEFAULT_LANGUAGE)
    tesseract.SetImage(img)
    tesseract.Recognize()
    print tesseract.GetUTF8Text()
    tesseract.End()

but what I am getting with this particular image in console is the following:
start >= 0 && start + num <= length_:Error:Assert failed:in file ratngs.cpp, line 321

Here is what I am using
tesserocr 2.2.1
tesseract 3.04.01
leptonica-1.71
libjpeg 8d : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8

I think I have all correctly set up because I have extracted text from other images. but with this one throws that "error"...
Any help is appreciated.
Thanks in advance!
c1

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions