How to Handle Duplicate License Plate Detections in YOLOv4 and OCR?

Hi,

I’m trying to use Hailo License Plate Recognition and the model works well and can clearly recognize the license plate.

However, when the model detects a license plate but can’t recognize the license plate number,


the bounding box is not discarded and becomes more and more as the frame increases, which eventually causes the system to delay or get stuck.

Is there any way to fix the recurring problem with the bounding box, or what part of the post-processing program should I adjust?

Thank you very much!

Hey @wesley.chen

It seems you’re having trouble with accumulating bounding boxes when license plate recognition fails. Here’s how to fix it:

  1. Filter low-confidence detections in post-processing:

    if (confidence_score > THRESHOLD) {
        // Keep and process
    } else {
        // Discard
    }
    
  2. Remove persistent unidentified boxes:

    if (frames_detected > MAX_ALLOWED_FRAMES) {
        // Discard
    }
    
  3. Use Non-Maximum Suppression to eliminate overlapping boxes:

    boxes = non_max_suppression(detections, overlap_threshold=0.5)
    
  4. Increase the model’s confidence threshold for detections.

  5. Optimize your tracking mechanism to properly manage boxes across frames.

These steps should reduce invalid box accumulation and improve your system’s performance. Let me know if you need more details on any of these solutions!

Regards,
Omri