openpaperwork / pyocr

A Python wrapper for Tesseract and Cuneiform -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/pyocr
931 stars 152 forks source link

CharBoxBuilder not working #55

Closed X-Wei closed 7 years ago

X-Wei commented 7 years ago

When I use CharBoxBuilder, I get this error:

>>> tool.image_to_string(subimg, builder=CharBoxBuilder())
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-127-d87b61b949c8> in <module>()
----> 1 tool.image_to_string(subimg, builder=CharBoxBuilder())

/home/miniconda2/lib/python2.7/site-packages/pyocr/libtesseract/__init__.pyc in image_to_string(image, lang, builder)
     91     try:
     92         tesseract_raw.set_page_seg_mode(
---> 93             handle, builder.tesseract_layout
     94         )
     95 

AttributeError: 'CharBoxBuilder' object has no attribute 'tesseract_layout'

my pyocr version: (0, 4, 2)

jflesch commented 7 years ago

Hello,

I believe this issue has already been solved in the latest version (0.4.6). Please upgrade PyOCR.

Best regards,