Fix compilation error
This commit is contained in:
@@ -83,18 +83,16 @@ void dehaze_scales( float* scales, int nscales, int mode, int s)
|
|||||||
|
|
||||||
void mean_stddv( float **dst, float &mean, float &stddv, int W_L, int H_L )
|
void mean_stddv( float **dst, float &mean, float &stddv, int W_L, int H_L )
|
||||||
{
|
{
|
||||||
float vsquared;
|
float vsquared = 0.f;
|
||||||
|
float sum = 0.f;
|
||||||
vsquared = 0.0f;
|
#pragma omp parallel for reduction(+:sum,vsquared) // this leads to differences, but parallel summation is more accurate
|
||||||
mean = 0.0f;
|
|
||||||
#pragma omp parallel for reduction(+:mean,vsquared) // this leads to differences, but parallel summation is more accurate
|
|
||||||
for (int i = 0; i <H_L; i++ )
|
for (int i = 0; i <H_L; i++ )
|
||||||
for (int j=0; j<W_L; j++) {
|
for (int j=0; j<W_L; j++) {
|
||||||
mean += dst[i][j];
|
sum += dst[i][j];
|
||||||
vsquared += (dst[i][j] * dst[i][j]);
|
vsquared += (dst[i][j] * dst[i][j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
mean /= (float) W_L*H_L;
|
mean = sum / (float) (W_L*H_L);
|
||||||
vsquared /= (float) W_L*H_L;
|
vsquared /= (float) W_L*H_L;
|
||||||
stddv = ( vsquared - (mean * mean) );
|
stddv = ( vsquared - (mean * mean) );
|
||||||
stddv = (float)sqrt(stddv);
|
stddv = (float)sqrt(stddv);
|
||||||
|
Reference in New Issue
Block a user