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

handle all rotation angles #515

Merged
merged 3 commits into from
Aug 23, 2021
Merged

handle all rotation angles #515

merged 3 commits into from
Aug 23, 2021

Conversation

abde0103
Copy link
Contributor

With the few changes I made, easyocr is now able to handle any rotation angle, not only 90 multiples and any length of "rotation_info" list in the "readtext" function.

@rkcosmos rkcosmos merged commit 009cd44 into JaidedAI:master Aug 23, 2021
@Jalmoru
Copy link

Jalmoru commented Feb 26, 2022

Did you try it in a straight texted image? It shouldn't be giving mirror-imaged texts or something but plain text.

@abde0103
Copy link
Contributor Author

Did you try it in a straight texted image? It shouldn't be giving mirror-imaged texts or something but plain text.

Note that character detection is only accurate when the text is in a horizontal position. Imagine you have an image with text at a 30 degree angle. The algorithm is not able to accurately read the characters. Now imagine you have an image with text slanted at 30 degrees and the user specifies that the text is slanted (e.g. he gives a list of 15,20,45 degrees), the algo rotates the image at the angles specified by the user and the detection will be more precise.

@cs19469
Copy link

cs19469 commented Mar 8, 2022

Hello, I want to detect the numbers in the picture, but it still can't be detected after rotation. Is there any problem with my usage?
result = reader.readtext(img1, rotation_info=[-10, 10, 20, 30, 45])
2

@abde0103
Copy link
Contributor Author

Hello, I want to detect the numbers in the picture, but it still can't be detected after rotation. Is there any problem with my usage? result = reader.readtext(img1, rotation_info=[-10, 10, 20, 30, 45]) 2

Nothing is wrong with your usage. The current version tests you different rotation angles and chooses the optimal one : the one which maximizes the prediction confidence, so the returned character detection will be done on one rotation angle which corresponds to the best one. In your case, you will not be able to read all the characters because they are slanted at different angles.

thuc-moreh pushed a commit to moreh-dev/EasyOCR that referenced this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants