Itseez/opencv — pull request #2547 by chrislgarry (2014-03-29 08:06:53+00:00)
Title:  Optimization of sigma computation in OpenCV 2.4.8 SIFT implementation (Bug #3625)

We can see that, according to the original code :

sig[0] = sigma
sig[i] = sqrt(sig_total * sig_total - sig_prev * sig_prev )
= sqrt(sig_prev * sig_prev * k * k - sig_prev * sig_prev )
= sig_prev * sqrt( k * k - 1 )
= k^(i-1) * sigma * sqrt( k * k - 1 )

then:

sig[0] = sigma
sig[1] = sigma * sqrt( k * k - 1 )
sig[2] = k * sigma * sqrt( k * k - 1 ) = k* sig[1]
sig[3] = k^2 * sigma * sqrt( k * k - 1 ) = k* sig[2]

We can optimize as done in the PR.

I've also added clarifying comments because of a bug report that was incorrectly filed due to lack of commentary.

http://code.opencv.org/issues/3625