mirror of
https://github.com/opencv/opencv.git
synced 2026-11-21 00:35:35 -06:00
XFeat letterboxes through blobFromImageWithParams(DNN_PMODE_LETTERBOX) but re-derived the resized size with cvRound, while dnn truncates. When the resized size had a fractional part >= 0.5, the pad offset was one network pixel off. It also divided by the nominal factor instead of the real per-axis ratio. Mirror dnn's truncation and map back with the exact per-axis inverse, and add a regression test with a non-integral letterbox (1000x901 into 640x640). Fixes #30548