openpaperwork / pyocr

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

No OCR tool found #13

Closed Williamvdb closed 10 years ago

Williamvdb commented 10 years ago

I have tesseract installed. I have used it many times before, but when I use this script:

from PIL import Image
import sys

import pyocr
import pyocr.builders

tools = pyocr.get_available_tools()
if len(tools) == 0:
    print("No OCR tool found")
    sys.exit(1)
tool = tools[0]
print("Will use tool '%s'" % (tool.get_name()))

langs = tool.get_available_languages()
print("Available languages: %s" % ", ".join(langs))
lang = langs[0]
print("Will use lang '%s'" % (lang))

txt = tool.image_to_string(Image.open('test.png'),
                           lang=lang,
                           builder=pyocr.builders.TextBuilder())
word_boxes = tool.image_to_string(Image.open('test.png'),
                                  lang=lang,
                                  builder=pyocr.builders.WordBoxBuilder())
line_and_word_boxes = tool.image_to_string(
        Image.open('test.png'), lang=lang,
        builder=pyocr.builders.LineBoxBuilder())

It says there is no OCR tool found. Any fix?

jflesch commented 10 years ago

I need more information:

Williamvdb commented 10 years ago

@jflesch I use mac. is this not supposed to work on a mac?

If it is, though, how do I put tesseract in my path?

jflesch commented 10 years ago

https://github.com/jflesch/pyocr#readme

It has been tested only on GNU/Linux systems. It should also work on similar systems (*BSD, etc). It doesn't work on Windows, MacOSX, etc.

I have no Mac. I can't test it on Mac, so I can't support it. Sorry.

deqiu commented 7 years ago

@jflesch I use it on Win10, and I also get ''No OCR Tool Found''. Doesn't it support windows?

jflesch commented 7 years ago

It does support Windows (see https://openpaper.work/download ). However, Tesseract.exe must be in your PATH.

viswa20 commented 7 years ago

hi @jflesch i can't found any exe in your package. Can you help me on this

jflesch commented 7 years ago

There are no .exe in Pyocr. Pyocr is a Python module designed to make it easier to use OCR tools from Python.

Pyocr looks for the OCR tools (Tesseract, Cuneiform, etc) installed on your system and just tells you what it has found.

You have to install Tesseract by yourself.

viswa20 commented 7 years ago

Thanks for your response

On 04-Apr-2017 4:12 PM, "Jerome Flesch" notifications@github.com wrote:

There are no .exe in Pyocr. Pyocr is a Python module designed to make it easier to use OCR tools from Python.

Pyocr looks for the OCR tools (Tesseract, Cuneiform, etc) installed on your system and just tells you what it has found.

You have to install Tesseract by yourself.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jflesch/pyocr/issues/13#issuecomment-291462879, or mute the thread https://github.com/notifications/unsubscribe-auth/AO5zwXI6BCmDkE98698nKFjkjmxvkRTHks5rsh54gaJpZM4BckNM .