AutoPlate - Character Bounding Boxes Missing #14351
Alabama20
started this conversation in
Ideas & Features
Replies: 2 comments 1 reply
-
Hi,
Options 2 and 3 do not provide any noticeable benefits. The time required for post-processing is disproportionate, with an efficiency close to 0.0000001%. Using alternative OCR solutions is not a viable option either; if they were effective, I wouldn’t have chosen your product in the first place.
This leaves only Option 1 as the feasible path forward if you are considering implementing this feature. There is significant demand in this area, and it’s likely that addressing it will become necessary sooner or later.
Sent from my iPhoneOn 9. Dec 2024, at 01:33, Wang Xin ***@***.***> wrote:
To address the issue of missing character bounding boxes in PaddleOCR for automatic license plate recognition (ALPR), you can explore the following solutions based on the referenced discussions and context provided:
1. Understanding the Problem
The current PaddleOCR detection model mainly provides line-level bounding boxes, which can limit its functionality for ALPR where character-level bounding boxes are critical. Without character-level localization, it becomes difficult to distinguish key segments like the city code, letters, and numbers in license plates.
2. Relevant Discussion
The user discussion in Getting character-level bounding boxes highlights similar challenges. PaddleOCR primarily supports line-level or word-level bounding boxes, and character-level bounding boxes are not directly available. However, there are potential approaches to address this:
3. Proposed Solutions
A. Retraining the Detection Model with Character-Level Annotations
Create Custom Annotations:
Modify your dataset (e.g., license plate images) to include character-level bounding box annotations instead of line-level annotations.
Use tools like LabelImg to label individual characters or adapt datasets like CCPD2020, which already encode character-level information in filenames.
Modify the Detection Model:
Fine-tune the detection model in PaddleOCR using the new character-level annotations.
Refer to the PaddleOCR documentation for training detection models with custom datasets: Training Detection Models.
Ensure the det_db algorithm parameters are adjusted to handle smaller bounding boxes, as characters are typically more compact than lines.
Expected Outcome:
The retrained model will output bounding boxes for each individual character, enabling precise segmentation of license plate components.
B. Use a Post-Processing Method to Derive Character-Level Boxes
If retraining is not feasible, a post-processing method can be applied to divide line-level bounding boxes into smaller character-level boxes.
Segment Line-Level Boxes:
After detecting line-level boxes, apply OCR recognition to extract the text.
Use the text length and box dimensions to split the bounding box into character-level boxes.
For example, divide the detected line into equal subregions corresponding to the number of characters in the recognized text.
Alignment Refinement:
Use heuristic rules or machine learning models to refine the alignment of the split boxes.
This works well for license plates with uniform character spacing.
C. Explore Alternative OCR Frameworks
If PaddleOCR cannot fulfill character-level detection requirements, consider combining its detection capabilities with other OCR engines like Tesseract, which supports character-level bounding boxes out of the box:
Use PaddleOCR for detection and recognition of the text.
Post-process the detected results using Tesseract to derive character-level bounding boxes.
D. Use Preprocessing to Improve Recognition
For tilted or skewed license plates, as discussed in Discussion 14243:
Apply affine transformations to align the characters before recognition.
Modify the detection model to detect rotated bounding boxes that better enclose skewed characters.
4. Additional Considerations
Performance Trade-offs: Character-level detection models may result in slightly slower inference due to the increased number of boxes.
Dataset Preparation: Ensure that your dataset includes representative samples of various license plate formats (e.g., tilted, skewed, or low-quality images).
Fine-Tuning Resources: Use pre-trained models like PP-OCRv3 as a starting point to reduce training time.
5. Conclusion
To address the absence of character-level bounding boxes in PaddleOCR for ALPR:
Option 1: Retrain the detection model with character-level annotations for precise results.
Option 2: Implement post-processing to split line-level boxes into character-level boxes.
Option 3: Combine PaddleOCR with frameworks like Tesseract for character-level bounding box extraction.
For a detailed implementation of character-level bounding boxes, the discussion Getting character-level bounding boxes provides valuable insights and steps.
Response generated by 🤖 feifei-bot | chatgpt-4o-latest
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
What about using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you're using PaddleOCR for automatic license plate recognition, it performs excellently—delivering high speed and impressive detection accuracy. However, there is one key challenge: you must return the character bounding boxes. Without them, detecting the city on the plate becomes difficult. Many countries follow the format: City/Space/Letters/Space/Numbers. If you return a single string without spaces, identifying the city becomes impossible. Without character bounding boxes, automatic license plate recognition cannot function effectively.
Beta Was this translation helpful? Give feedback.
All reactions