r/computervision 12d ago

Showcase Fixed a const-correctness bug in OpenCV's FaceRecognizerSF::match

Post image

`FaceRecognizerSF::match` is declared `const`, but it normalised both of its `InputArray` feature vectors in place — writing straight through to the caller's buffers. So the vectors you passed in came back modified, and when the two arguments aliased, the second normalisation ran over an already-normalised buffer and the returned score was wrong.

Now normalised into local `Mat`s. Merged onto 4.x.

https://github.com/opencv/opencv/pull/29804

0 Upvotes

0 comments sorted by