Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdin option doesn't work for psm 0 and 2 #85

Closed
catethos opened this issue Aug 26, 2015 · 5 comments
Closed

stdin option doesn't work for psm 0 and 2 #85

catethos opened this issue Aug 26, 2015 · 5 comments
Labels
feature request OSD Orientation and Script Detection

Comments

@catethos
Copy link

I am using the master branch from github (3.05.00dev) and facing some problems when using the stdin option in conjunction with the -psm 0 and -psm 2 options

cat <image file> | tesseract stdin stdout -psm 0

gives me the error

Error in fopenReadStream: file not found
Error in pixRead: image file not found: stdin
Cannot open input file: stdin

However, the command

cat <image file> | tesseract stdin stdout -psm 1

works as expected.

Do I miss something?

Regards,
Caleb

@zdenop
Copy link
Contributor

zdenop commented Sep 4, 2015

At the moment stdin is supported only for OCR.
PSM_AUTO_ONLY (0) and PSM_OSD_ONLY (2) expects to read data based on filename

@jflesch
Copy link

jflesch commented Sep 9, 2015

Just so you know, if I'm not mistaken, it worked with Tesseract 3.03 and only broke with Tesseract 3.04. It is also very handy to script around Tesseract (avoid using temporary files) (see Pyocr for instance).

@zdenop
Copy link
Contributor

zdenop commented Sep 10, 2015

@jflesch: I am currios: Why you call tesseract executable from python instead of using C-API? IMO it should be faster...

@jflesch
Copy link

jflesch commented Sep 10, 2015

When I started working on PyOCR, it was still Tesseract 2.x. At the time, if I remember correctly, there was only a C++ API and it seemed painfully hard to use (and binding on C++ API from Python is really annoying).
Also I did fork PyOCR from an already-existing python module (python-tesseract if I recall correctly).

Good to know there is a C API now. I'll have a look, see if I can bind on it easily. Thanks for the tip :)

@zdenop
Copy link
Contributor

zdenop commented Oct 30, 2015

fixed with 7089c7b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request OSD Orientation and Script Detection
Projects
None yet
Development

No branches or pull requests

4 participants