Skip to content

A couple of bugs #5

@MatejVitek

Description

@MatejVitek

First off, thanks for this library, it sped up the OCR in my code by 8-10x relative to pytesseract (which I was using previously).

I've noticed a couple of bugs in the (0.1.0) code though:

  1. Line 262 raised an AttributeError for me so I had to change it (I just used dirname(abspath(__file__)) instead, which sets the working dir to where pytessy is installed).
  2. justread_raw calls get_text, I think it should be calling get_text_raw instead.

For reference and for future users, I'm leaving my code here as a sample:

from pytessy.pytessy import PyTessy

ocr = PyTessy(r'C:\Program Files\Tesseract-OCR\tesseract')

bytes = img.tobytes()  # img is a numpy array, such as from np.array(PIL.Image.open(file))
h, w = img.shape[:2]
bpp = len(bytes) // (w * h)
txt = ocr.read(bytes, w, h, bpp)

Metadata

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