Skip to content

license_plate_detection_yunet: fix NMSBoxes input (use [x,y,w,h] from 4-point corners)#298

Open
Hariom-Nagar211 wants to merge 1 commit into
opencv:mainfrom
Hariom-Nagar211:fix/lpd_yunet-nmsboxes-format
Open

license_plate_detection_yunet: fix NMSBoxes input (use [x,y,w,h] from 4-point corners)#298
Hariom-Nagar211 wants to merge 1 commit into
opencv:mainfrom
Hariom-Nagar211:fix/lpd_yunet-nmsboxes-format

Conversation

@Hariom-Nagar211

Copy link
Copy Markdown

What

Fix NMSBoxes usage in lpd_yunet.py.
Previously, it passed [x1, y1, x2, y2] (corner coords), but cv.dnn.NMSBoxes expects [x, y, w, h].

How

  • Convert the 4-point quadrilateral into axis-aligned [x, y, w, h] rectangles only for NMS.
  • Use returned indices (keepIdx) to filter the original quadrilateral detections.
  • Normalize keepIdx across OpenCV versions (tuple vs array).

Why

Notes

  • Tested with sample images: overlapping plates are suppressed correctly, and detections remain quadrilateral-shaped.

…t from 4-point corners); keep original quad dets. Fixes opencv#275
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.

1 participant