python - How do I plot FFT in Numpy -


This seems like a very simple question, yet I could not find any documents for it.

I have an image in Nampee, and I want to do imshow the FFT.

I can just do it

  F = fft (myimg)) Imshow (f)   

I do not do this in Namie Because the F complex is valuable. Trying to do imshow (real (f)) gives me an all black image - I'm guessing because 0. [0,1] instead of 0. 0 Multiplying by 255 also does not fix this issue.

How to get my plot any idea?

Update:

Okay, Nattan told me how I was simplifying this problem wrongly. Allow me slightly backwards I have a video matrix of dimensions (200, 30, 30, 3). For every color channel of 200 frames, 30x30 pixels, 3 color channels for each pixel, I want to calculate the fft of that pixel in time in the series. This should give me a new matrix that is (20030303,3) for each pixel, in each color channel, a 200-dim floating fourier conversion of each pixel. So I should be able to see the image created by the values ​​of the first coefficient of Fourier in each pixel.

Note that matlab fft is running on the first nonnationalington dimension, so F = fft (video) what I'm doing is doing it.

Here is an example for a 2D image that is used for SPP:

  import sepie import fftpack import numpy as np import Take the Fourier conversion of pylab # image as import. F1 = fftpack.fft2 (myimg) #Change now so that the low spatial frequency is in the center. F2 = fftpack.fftshift (F1) # 2D power spectrum is: psd2d = np.abs (F2) ** 2 # plot power spectrum pie.figger (1) py.clf () py.imshow (psf2d) py. Show ()   

You can look for 1D trace and example ...

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -