From f3331567eeba6a753bf3287455a28830015e4e79 Mon Sep 17 00:00:00 2001 From: Hombre Date: Tue, 19 Oct 2010 01:41:14 +0200 Subject: [PATCH] Bug correction in the DIRPYREQUALIZER that created random noise in the image. --- rtengine/dirpyr_equalizer.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 67ce8f1f0..6c6cb82bc 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -194,7 +194,7 @@ namespace rtengine { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - }; + } void ImProcFunctions::dirpyr_channel(unsigned short ** data_fine, unsigned short ** data_coarse, int width, int height, int * rangefn, int level, int scale, const double * mult ) { @@ -220,7 +220,7 @@ namespace rtengine { #endif for(int i = 0; i < height; i++) { for(int j = 0; j < width; j++) - { + { float val=0; float norm=0; @@ -238,14 +238,12 @@ namespace rtengine { - }; + } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void ImProcFunctions::idirpyr_eq_channel(unsigned short ** data_coarse, unsigned short ** data_fine, int ** buffer, int width, int height, int level, const double * mult ) { - int hipass; - float noisehi = 1.33*noise*mult[4]/pow(3,level), noiselo = 0.66*noise*mult[4]/pow(3,level); float * irangefn = new float [0x20000]; @@ -265,15 +263,16 @@ namespace rtengine { #ifdef _OPENMP #pragma omp parallel for #endif - for(int i = 0; i < height; i++) + for(int i = 0; i < height; i++) { for(int j = 0; j < width; j++) { - hipass = (data_fine[i][j]-data_coarse[i][j]); + int hipass = (data_fine[i][j]-data_coarse[i][j]); buffer[i][j] += irangefn[hipass+0x10000] * hipass ; } + } delete [] irangefn; - }; + } #undef DIRWT_L