#include #include #include #include //#include #include using std::endl; using std::setw; void atrous2DReconstruct(long &xdim, long &ydim, float *&input,float *&output, Param &par) { extern Filter reconFilter; bool flagBlank=par.getFlagBlankPix(); float blankPixValue = par.getBlankPixVal(); long size = xdim * ydim; long mindim = xdim; if (ydimmaxNumScales2D){ std::cerr<<"Error in atrous2DReconstruct:: numScales ("< "<ct1)&&(input[row*xdim+ct2]==blankPixValue) ) ct2--; xLim1[row] = ct1; xLim2[row] = ct2; avGapX += ct2 - ct1; } avGapX /= float(ydim); for(int col=0;colct1)&&(input[col+xdim*ct2]==blankPixValue) ) ct2--; yLim1[col] = ct1; yLim2[col] = ct2; avGapY += ct2 - ct1; } avGapY /= float(ydim); mindim = int(avGapX); if(avGapY < avGapX) mindim = int(avGapY); numScales = reconFilter.getNumScales(mindim); /***********************************************************************/ /***********************************************************************/ float threshold; int iteration=0; newsigma = 1.e9; for(int i=0;i=ydim) y = 2*(ydim-1) - y; // reflection. // while((yyLim2)){ // if(yyLim2) y = 2*yLim2 - y; // reflection. // } // boundary conditions are reflection. for(int xoffset=-filterHW; xoffset<=filterHW; xoffset++){ int x = xpos + spacing*xoffset; int newx; //if(x<0) x = -x; // boundary conditions are // if(x>=xdim) x = 2*(xdim-1) - x; // reflection. //while((xxLim2)){ // if(xxLim2) x = 2*xLim2 - x; // reflection. // } // boundary conditions are reflection. while((yyLim2[xpos])){ if(yyLim2[xpos]) y = 2*yLim2[xpos] - y; } while((xxLim2[ypos])){ if(xxLim2[ypos]) x = 2*xLim2[ypos] - x; } // if(yyLim2[xpos]) newy = 2*yLim2[xpos] - y; // else newy = y; // if(xxLim2[ypos]) newx = 2*xLim2[ypos] - x; // else newx=x; // x = newx; // y = newy; int filterpos = (yoffset+filterHW)*reconFilter.width() + (xoffset+filterHW); int oldpos = y*xdim + x; if(isGood[pos]) wavelet[pos] -= filter[filterpos] * coeffs[oldpos]; } //-> end of xoffset loop } //-> end of yoffset loop } //-> end of else{ ( from if(!isGood[pos]) ) } //-> end of xpos loop } //-> end of ypos loop // Need to do this after we've done *all* the convolving for(int pos=0;pos=par.getMinScale()){ array = new float[size]; goodSize=0; for(int pos=0;pos threshold ) output[pos] += wavelet[pos]; } } spacing *= 2; } // END OF LOOP OVER SCALES for(int pos=0;pos reconTolerance) ); if(par.isVerbose()) std::cout << "Completed "<