python - FFT in SimpleCV? -
I'm searching SimpleCV in Python as an imaging library, and it looks great. However, I have been stumped about how to do FFT on an image in direct CCV. It seems that I have to convert a first spiked array, and then use numpy features:
Import SV as SimpleCV IM = image ( 'image.png') img = +1 im.getGrayNumpy () Imf = np.fft.fftshift (np.fft.fft2 (img)) plt.imshow (log (abs (IMF)), Semeep = Semikgret) Or maybe this is the best way? And of course if I want to log a free spectrum for later use in a simple CV image, then this is another issue ...
you numpy matrix SimpleCV to image () constructor: Using it. import scipy import numpy as np import simplecv as scv cam = scv.Camera () disp = scv.Display () while disp.isNotDone (): Current = cam.getImage (). Resize (w = 768) matrix = Current.getGrayNumpy () spectrum = np.abs (np.log (np.fft.fftshift (np.fft.fft2 (matrix))) spectrum * = 255 / Spektrmkmaks () scv Show Image (). If disp.mouseLeft: Break
Comments
Post a Comment