#include #include #include #include #include using std::endl; using std::setw; void atrous1DReconstruct(long &xdim, float *&input,float *&output, Param &par) { extern Filter reconFilter; const float SNR_THRESH=par.getAtrousCut(); const int MIN_SCALE=par.getMinScale(); bool flagBlank=par.getFlagBlankPix(); float blankPixValue = par.getBlankPixVal(); int numScales = reconFilter.getNumScales(xdim); double *sigmaFactors = new double[numScales+1]; for(int i=0;i<=numScales;i++){ if(i<=reconFilter.maxFactor(1)) sigmaFactors[i] = reconFilter.sigmaFactor(1,i); else sigmaFactors[i] = sigmaFactors[i-1] / sqrt(2.); } float mean,sigma,originalSigma,originalMean,oldsigma,newsigma; bool *isGood = new bool[xdim]; for(int pos=0;pos=xdim) x = 2*(xdim-1) - x; // reflection. // if(xxLim2) x = 2*xLim2 - x; // reflection. while((x<0)||(x>=xdim)){ if(x<0) x = 0 - x; else if(x>=xdim) x = 2*(xdim-1) - x; } int filterpos = (xoffset+filterHW); int oldpos = x; if(isGood[oldpos]) wavelet[pos] -= filter[filterpos]*coeffs[oldpos]; } //-> end of xoffset loop } //-> end of else{ ( from if(!isGood[pos]) ) } //-> end of xpos loop for(int pos=0;pos=MIN_SCALE){ array = new float[xdim]; goodSize=0; for(int pos=0;pos(mean+SNR_THRESH*originalSigma*sigmaFactors[scale])) output[pos] += wavelet[pos]; } } spacing *= 2; } //-> end of scale loop for(int pos=0;pos reconTolerance) ); if(par.isVerbose()) std::cout << "Completed "<