Bug Report: Incorrect Character Box Order for Inverted Text when return_word_box is enabled #14570
Replies: 3 comments
-
For immediate use, you can implement a simple workaround:
Python Example:def reorder_bounding_boxes(boxes, is_inverted):
"""
Reorders bounding boxes to match the original input orientation.
Args:
boxes (list): List of bounding box coordinates.
is_inverted (bool): Whether the input text was inverted.
Returns:
list: Adjusted bounding box coordinates.
"""
if is_inverted:
return boxes[::-1]
return boxes |
Beta Was this translation helpful? Give feedback.
-
Thank you, I already use a very similar workaround in my project. But the angle_cls seems to fail in some of the cases I am handling. However the recognition for these cases seems to do fine when angle_cls is enabled which i assume is due to some kind of threshold based fallback mechanism set up in the recognition pipeline. |
Beta Was this translation helpful? Give feedback.
-
This bug report describes an issue with the character bounding box order when processing inverted text (right-to-left visual orientation) using PaddleOCR. Below is a detailed analysis and potential recommendations: Issue Analysis:
Recommendations:
Related Issues/Discussions:Although no directly related issues were found during the provided searches, this bug aligns with common OCR challenges involving text orientation and bounding box consistency. Users facing similar issues with bounding box order may benefit from contributing to this discussion or creating a new feature request in the PaddleOCR GitHub repository. Conclusion:This bug represents a mismatch between text recognition (logical content) and bounding box ordering (spatial orientation). Adjustments to the post-processing logic or a custom script can help address this issue until it is resolved in PaddleOCR. Consider contributing this feedback to the PaddleOCR team for further improvement. Response generated by feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🔎 Search before asking
🐛 Bug (问题描述)
Bug Report: Incorrect Character Box Order for Inverted Text
Description
When processing inverted text using PaddleOCR, the OCR engine successfully detects the correct text content (because angle cls is enabled). However, the order of the character-level bounding boxes remains inconsistent with the orientation of the original input text.
For instance:
When the text is inverted (right-to-left in the image), PaddleOCR correctly detects the text as left-to-right in content. However, the character bounding boxes should follow the original right-to-left order of the inverted input.
Conversely, when text is naturally written left-to-right, the bounding boxes are ordered correctly.
This creates confusion when the bounding box coordinates are used for downstream processing or analysis.
Steps to Reproduce
Expected Behavior
For inverted text:
Actual Behavior
Example Data
Input 1:
Input 2:
🏃♂️ Environment (运行环境)
kaggle notebook.
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
any image, run through OCR before and after inversion.
Beta Was this translation helpful? Give feedback.
All reactions