Revision history [back]

phasecorr.cpp function magSpectrums() DC component missed the square root operation

There is a possible bug in function magSpectrums(), it seems that the calculation of magnitude of DC component (the first element) is wrong, it has missed the square root operation.

    if( !is_1d && cn == 1 )
{
for( k = 0; k < (cols % 2 ? 1 : 2); k++ )
{
if( k == 1 )
dataSrc += cols - 1, dataDst += cols - 1;
dataDst[0] = dataSrc[0]*dataSrc[0]; /// DC component
if( rows % 2 == 0 )
dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc]; /// DC component

for( j = 1; j <= rows - 2; j += 2 )
{