opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.43k stars 5.76k forks source link

Typo in LandmarkLBF.cpp #3581

Open TonyCongqianWang opened 1 year ago

TonyCongqianWang commented 1 year ago

In the supportVectorRegression(...) function of LandmarkLBF.cpp there is a typo. lambda and _upperbound were declared as a size 1 array, but it was supposed to be a size l array! This can be verified by looking at the "original" code the algorithms was based of. And indeed, on github, it is almost impossible to tell the difference between l and 1. This typo results in some nan values and occasional crashes due to segfaults (not suprising, considering the array size is too small!).

https://github.com/scikit-learn/scikit-learn/commit/2b60d329770206a32e1cb8d1bf78bf05141e3033#diff-bf60bef97c003384f56a1fd92fe102f6ac1eea40298e911dd95b4d28601bbc14 (line 830 in linear.cpp)

asmorkalov commented 1 year ago

@TonyCongqianWang Thanks a lot! Feel free to submit PR.