Thread: fft3dGPU 0.8.2
View Single Post
Old 15th February 2005, 09:44   #12  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
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.

Last edited by tsp; 15th February 2005 at 18:05.
tsp is offline   Reply With Quote