IOError for OSD (psm 0)
See original GitHub issueRunning pytesseract on Raspbian, python 2.7, tesseract 4.00 (4.00.00dev-625-g9c2fa0d).
My code is as follows:
ret = image_to_string(im,lang='eng',boxes=False, config="-psm 0")
Error:
Traceback (most recent call last):
File "/home/pi/Vocable/TESTING.py", line 114, in <module>
ret = image_to_string(im,lang='eng',boxes=False, config="-psm 0")
File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 126, in image_to_string
f = open(output_file_name, 'rb')
IOError: [Errno 2] No such file or directory: '/tmp/tess_lN5JlN.txt'
If I run code with psm 1 [Recognition with OSD], I receive no errors but the upside down text is simply treated as right-side-up text, producing garbage results. (This was tested on an inverted test.png)
Essentially text recognition works but OSD does not.
Issue Analytics
- State:
- Created 6 years ago
- Comments:18
Top Results From Across the Web
Error setting psm for pytesseract - Stack Overflow
I'm trying to use a psm of 0 with pytesseract, but I'm getting an error. My code is: import pytesseract from PIL import...
Read more >How to use the tesserocr.PSM.AUTO_OSD function in ... - Snyk
PSM.AUTO_OSD function in tesserocr. To help you get started, we've selected a few tesserocr examples, based on popular ways it is used in...
Read more >tesseract - T-Plan Robot Documentation
The OCR makes the calling command return 1 when the OCR throws an error caused by misconfiguration or an I/O error. Text of...
Read more >pytesseract.py 2019-09-18 02:24 13 KB
STRING, timeout=0): """ Returns string containing the orientation and script detection (OSD) """ config = '{}-psm 0 {}'.format( '' if ...
Read more >Welcome to ODASD(Product Support) - OUSD A&S
The next PSM Workshop is scheduled to take place September 13-15, 2022 at the General Jacob E. Smart Conference Center on Joint Base...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@movaid7 I suggest leaving the image_to_string function as it is (logically) - returning text or raising error exception, when there is no txt file. And we can have new function image_to_file - returning list of temp file path strings created by tesseract. (In this case, the user should parse the files manually according to his/her use case)
The orientation parameter is not available with image_to_data, right?