Bug in downhill_simplex? [closed]
I was attempting to use the downhill_simplex method in OpenCV for an alignment problem. However, I found that when calling DownhillSolver::minimize(x), values of x were ignored, and the algorithm always starts at zero.
Looking at the source code, I think there is a bug on line 357 in downhill_simplex.cpp:
simplex.row(0).copyTo(proxy_x);
// this line should be:
// proxy_x.row(0).copyTo(simplex);
createInitialSimplex(simplex,_step);
double res = innerDownhillSimplex(
simplex,_termcrit.epsilon, _termcrit.epsilon, count,_Function,_termcrit.maxCount);
simplex.row(0).copyTo(proxy_x);
Please make a pull-request and/or create a ticket at http://code.opencv.org/projects/opencv/issues. Thank you!
Here's the ticket: http://code.opencv.org/issues/3990 Maybe I'll do the pull request this weekend..