|
|
|
@ -78,9 +78,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst) |
|
|
|
|
{ |
|
|
|
|
if( k == 1 ) |
|
|
|
|
dataSrc += cols - 1, dataDst += cols - 1; |
|
|
|
|
dataDst[0] = dataSrc[0]*dataSrc[0]; |
|
|
|
|
dataDst[0] = (float)std::abs(dataSrc[0]); |
|
|
|
|
if( rows % 2 == 0 ) |
|
|
|
|
dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc]; |
|
|
|
|
dataDst[(rows-1)*stepDst] = (float)std::abs(dataSrc[(rows-1)*stepSrc]); |
|
|
|
|
|
|
|
|
|
for( j = 1; j <= rows - 2; j += 2 ) |
|
|
|
|
{ |
|
|
|
@ -97,9 +97,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst) |
|
|
|
|
{ |
|
|
|
|
if( is_1d && cn == 1 ) |
|
|
|
|
{ |
|
|
|
|
dataDst[0] = dataSrc[0]*dataSrc[0]; |
|
|
|
|
dataDst[0] = (float)std::abs(dataSrc[0]); |
|
|
|
|
if( cols % 2 == 0 ) |
|
|
|
|
dataDst[j1] = dataSrc[j1]*dataSrc[j1]; |
|
|
|
|
dataDst[j1] = (float)std::abs(dataSrc[j1]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for( j = j0; j < j1; j += 2 ) |
|
|
|
@ -122,9 +122,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst) |
|
|
|
|
{ |
|
|
|
|
if( k == 1 ) |
|
|
|
|
dataSrc += cols - 1, dataDst += cols - 1; |
|
|
|
|
dataDst[0] = dataSrc[0]*dataSrc[0]; |
|
|
|
|
dataDst[0] = std::abs(dataSrc[0]); |
|
|
|
|
if( rows % 2 == 0 ) |
|
|
|
|
dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc]; |
|
|
|
|
dataDst[(rows-1)*stepDst] = std::abs(dataSrc[(rows-1)*stepSrc]); |
|
|
|
|
|
|
|
|
|
for( j = 1; j <= rows - 2; j += 2 ) |
|
|
|
|
{ |
|
|
|
@ -141,9 +141,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst) |
|
|
|
|
{ |
|
|
|
|
if( is_1d && cn == 1 ) |
|
|
|
|
{ |
|
|
|
|
dataDst[0] = dataSrc[0]*dataSrc[0]; |
|
|
|
|
dataDst[0] = std::abs(dataSrc[0]); |
|
|
|
|
if( cols % 2 == 0 ) |
|
|
|
|
dataDst[j1] = dataSrc[j1]*dataSrc[j1]; |
|
|
|
|
dataDst[j1] = std::abs(dataSrc[j1]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for( j = j0; j < j1; j += 2 ) |
|
|
|
|