Bug in downhill_simplex? [closed]

asked 2014-10-30 15:59:32 -0600

tobyr gravatar image

updated 2017-08-22 16:20:15 -0600

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);
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-09-13 11:32:41.194780

Comments

1

Please make a pull-request and/or create a ticket at http://code.opencv.org/projects/opencv/issues. Thank you!

Guanta gravatar imageGuanta ( 2014-10-31 06:45:43 -0600 )edit
1

Here's the ticket: http://code.opencv.org/issues/3990 Maybe I'll do the pull request this weekend..

tobyr gravatar imagetobyr ( 2014-10-31 14:39:54 -0600 )edit