Hi all, Discovered sci-image recently, and I like it so far. Right now I am basically trying to do an fft, filter out certain frequencies, and then back transform it to an image. My first thought was to use fft, but I can't find an fft function in the docs. I see that numpy has an fft function, but running that on a sci-kit image gives unpleasant errors. Is there perhaps a better method for this than fft? Any suggestions? chris
Hi Chris, One of our main selling points is that we interop seamlessly with numpy. Doing an fft is one of those interops! Indeed it should "just work". Can you post more details about the error you're seeing? Welcome! =) Juan. On Fri, Oct 17, 2014 at 7:26 AM, Christopher <spagodo@gmail.com> wrote:
Hi all, Discovered sci-image recently, and I like it so far. Right now I am basically trying to do an fft, filter out certain frequencies, and then back transform it to an image. My first thought was to use fft, but I can't find an fft function in the docs. I see that numpy has an fft function, but running that on a sci-kit image gives unpleasant errors. Is there perhaps a better method for this than fft? Any suggestions? chris -- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Thanks Juan for the response! It appears that the problem was that numpy fft returns a complex array, which gave an error when trying to display it. By extracting only the real parts of the array, it seems to work fine. This is a sample of what I was trying to do: import numpy from numpy import fft from skimage import io, data import matplotlib.pyplot as plot im = data.coffee() f = fft.fft2(im) f2 = fft.ifft2(f) r = numpy.real(f2) plot.imshow(r) plot.show() Thanks again
Hi Chris Welcome to the list! On Oct 16, 2014 10:26 PM, "Christopher" <spagodo@gmail.com> wrote:
Discovered sci-image recently, and I like it so far. Right now I am
basically trying to do an fft, filter out certain frequencies, and then back transform it to an image. My first thought was to use fft, but I can't find an fft function in the docs. I see that numpy has an fft function, but running that on a sci-kit image gives unpleasant errors. Is there perhaps a better method for this than fft? Any suggestions? Have a look at the exercise for the FFT chapter in the scipy lecture notes: http://scipy-lectures.github.io/intro/scipy.html#id4 This is very close to what you're trying to do. Regards Stéfan
participants (3)
-
Christopher
-
Juan Nunez-Iglesias
-
Stéfan van der Walt