[SciPy-User] [SciPy-user] 2D Autocorrelation
Sturla Molden
sturla at molden.no
Tue Sep 22 09:33:17 EDT 2009
magnus_p skrev:
> def addAutocorr(self, cube):
> a = zeros((self.CUBESIZE,self.CUBESIZE))
> for frame in cube:
> a += ifft2(fft2(frame)*fft2(frame))
> return a
>
This is a auto-convolution, not an auto-correlation. Try this instead:
a += ifft2(fft2(frame)*fft2(fliplr(flipud(frame))))
And also do something to control edge effects (e.g. pad with zeros and
crop).
More information about the SciPy-User
mailing list