Fizick I have added the normalization code to sigma. The only thing I can't seem to figure out is how to apply the 2d window function. At the moment I'm using af 1d window but this produces artifact with sigma values above 10.
When just multiplying the cosx and cosy values I get a checkboard pattern(when the picture is shifted bw/2 and bh/2 and summed the factor doesn't add up to 1.
edit
nevermind I cheated and used this as the window function:
Code:
void ImgStream::CreateFactorMap(float* Map,int x,unsigned int xnum,int y,unsigned int ynum,bool shift)
{
double cosy,cosx;
unsigned int offset=0;
double x1=x;
double y1=y;
//xnum=xnum/2;
//ynum=ynum/2;
for(unsigned int repy=0;repy<(ynum+shift);repy++){
for(double n1=(shift&&(repy==0||repy==ynum)?0:-y1/2.0)+0.5;n1<y1/2.0;n1++){
cosy=cos(n1*pi/(y1));
for(unsigned int repx=0;repx<(xnum+shift);repx++){
for(double n2=(shift&&(repx==0||repx==xnum)?0:-x1/2.0)+0.5;n2<x1/2.0;n2++){
cosx=cos(n2*pi/(x1));
Map[offset++]=sqrt(0.5*(cosx*cosx+cosy*cosy));
}
}
}
}
}
I have upload version 0.2 where the sigma values should work like fizick's fft3dfilter.