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
OSD #105
Comments
Did you first tried the same CLI command equivalent in terminal/shell? PS: Also for the output_type, try to use the pytesseract.Output class attributes instead of hard-coding it, because the notation can change in the future and this can break your code. :) |
Thank you for the help in advance.
I think is because --psm 0 creates an .osd file instead of .txt file |
That's correct, but what is the raw output message from the tesseract command itself? I guess that we need additional function/s (or functionality) for the different PSM modes, since the output format is not txt. |
|
The warning is familiar to me, the problem is that tesseract doesn't return exit code 0 in that case, which is not nice :D But the warning itself means that there is a missing image metadata information. Maybe a beforehand conversion of the image can help. At the moment we should adjust the pytesseract logic at two places in order to be able to read and return the content of the .osd file. Can you try to report the exit code of the tesseract command. echo $? Also try to convert the image in order to workaround the tesseract warning. |
The exit code when run in the terminal is 0. But when run through pytesseract it is not, do you have any idea why? |
You can patch the pytesseract library temporarily on line 133 and you can print the command with: print(' '.join(command)) PS: We have a new function image_to_osd. You can try your example images with it. |
your pytesseract.py doesn't exist anymore. Please upload again. |
The comment is from 2018, so things might have changed. The file still exists, although the directory structure has been migrated and this file is available at https://github.com/madmaze/pytesseract/blob/master/pytesseract/pytesseract.py now. At the moment, you will have to add the print statement to this line: pytesseract/pytesseract/pytesseract.py Line 253 in 32454d2 |
ok, thanks, I download and replace the file. Now, I have another problem with this
|
You did not download the actual (raw) file, but the rendered HTML code from GitHub. |
ok, I download, and change the line. But I get the same error. Can you please attach the file, after edit with one of those 2 commands?
I realy don't understand where to change the file. Because I change many time, and didn't work. Please edit and attach here the new version, please. |
I still do not get what you want to achieve: What is your intent with commenting on this old issue and trying to do some changes there? If it is related to #455, please answer the actual questions there. You will (usually) never be able to fix an issue by just printing anything to the terminal - the |
As mentioned previously, please keep these issues separate ones - the issue from your last comment is already discussed in #455, while asking twice will not really change anything about the support. |
Hello,
Is it possible to use psm 0 to get the osd information? I am geting an error doing this.
The text was updated successfully, but these errors were encountered: