MAIN:

Code:

vector< vector<double> >radius(rows, vector<double>(cols);
vector< vector<double> >theta(rows,cols);

Code:

pre_filter_Computations(radius,theta,cols,rows);

function:

Code:

void pre_filter_Computations(vector< vector<double> >& radius,vector< vector<double> >& theta,int cols,int rows){
vector<double>x(cols); vector<double>y(rows);
vector< vector<double> >X(cols, vector<double>(rows));
vector< vector<double> >Y(cols, vector<double>(rows));
double epsilon = 0.0001;
printf("welcome\n");
for(int i=0;i<cols;i++);{
x[i]=((double)(i-cols)/2)/((double)cols/2);
}
for(int z=0;z<rows;z++){
y[z]=-(((double)(z-rows)/2)/((double)rows/2));
}
for(int m=0;m<cols;m++){
for(int n=0;n<rows;n++){
X[m][n]=x[m];
Y[m][n]=y[n];
}
}
for(int a=0;a<rows;a++){
for(int b=0;b<cols;b++){
X[a][b] = pow(X[a][b],2);
Y[a][b] = pow(Y[a][b],2);
X[a][b] = X[a][b] + Y[a][b];
radius[a][b] = sqrt(X[a][b]);
}
}
radius[rows/2][cols/2]=1;
for(int a=0;a<rows;a++){
for(int b=0;b<cols;b++){
radius [a][b]= radius[a][b] + epsilon;
theta[a][b] = atan2(Y[a][b],X[a][b])*180/PI;
}
}
}