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
incorrectly detects orientation #4
Comments
Strange, just tested it with eurotext.tif (both original and flipped upside-down) and it output correct results: with tesserocr.PyTessBaseAPI(psm=tesserocr.PSM.AUTO_OSD) as api:
for image in ['eurotext.tif', 'eurotext_flipped.tif']:
image = Image.open(image)
api.SetImage(image)
api.Recognize()
it = api.AnalyseLayout()
print it.Orientation() Output:
|
My output
versions reubano@tokpro [~]⚡ pip freeze | grep tesserocr
tesserocr==2.0.0
reubano@tokpro [~]⚡ tesseract --version
tesseract 3.04.00
leptonica-1.73
libgif 4.2.3 : libjpeg 9a : libpng 1.6.21 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.5.0 : libopenjp2 2.1.0 fyi, tesserocr 2.0.1 isn't on pypi. |
Could you please share your images so I can properly test this? |
Same one you linked |
2.0.1 doesn't have any changes to the source code so it won't differ from v2.0.0, main difference between our environments are the dependencies. Mine are:
Yours are more recent but I don't see why this should affect the output. The example you're trying is based on the C API example here. I'm using the packages provided in my default PPAs (Ubuntu 15.10) but I'll try to at least test with an updated compilation of leptonica and see if that changes anything. Would appreciate it if you can test on a different environment as well if possible and see if that gives different results. |
I use macports which doesn't really let you downgrade a package. If it helps, I have |
I think the issue is with tesseract's (or maybe leptonica's) api. I modified code from nidaba to call the c-api directly and got similar results. |
Given that using the tesseract executable returns correct results, it's very possible that the problem is with the API interface. Certainly worth investigating. |
I was able to downgrade to |
Glad you were able to pin the cause down. Still weird that you got the correct result with the tesseract executable though. |
Go figure... hopefully someone smarter than me can figure that out. |
Just a note for anyone else that the (macports) program |
I've noticed the orientation example doesn't distinguish between upside down/rightside up and clockwise/counter clockwise orientations.
The text was updated successfully, but these errors were encountered: