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

OCR boxes: is there a way to sort boxes left to right #1274

Open
PrathibhaPA opened this issue Jul 1, 2024 · 1 comment
Open

OCR boxes: is there a way to sort boxes left to right #1274

PrathibhaPA opened this issue Jul 1, 2024 · 1 comment

Comments

@PrathibhaPA
Copy link

PrathibhaPA commented Jul 1, 2024

Easyocr does a pretty good job in giving back bboxes. But recently I noticed that bboxes are not in order. I figured out that when the texts are slightly disoriented, the bbox for the text at the higher level is placed first in order. For example, this is my sample output:
image
(box number is the index of each bbox)
In this:
Boxing order should have been: ([[25, 215], [97, 215], [97, 229], [25, 229]], 'Education:', 0.999906885180935), ([[134, 200], [286, 200], [286, 226], [134, 226]], 'BA in Psychology', 0.9998934803292433)]])
and when i concat I should get: Education: BA in psychology

But I actually get:
([[134, 200], [286, 200], [286, 226], [134, 226]], 'BA in Psychology', 0.9998934803292433), ([[25, 215], [97, 215], [97, 229], [25, 229]], 'Education:', 0.999906885180935))]
and if concat the text: I get BA psychology Education:
So I wanted to know if there is any way I can sort the bboxes left to right line by line.

@PrathibhaPA PrathibhaPA changed the title OCR boxes: is there a way to sort boxes left to right via line to line OCR boxes: is there a way to sort boxes left to right Jul 1, 2024
@alexb231
Copy link

i think setting paragraph = true
in the readtext might do the trick here

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

No branches or pull requests

2 participants