Add titles
This commit is contained in:
parent
db2e19738e
commit
337a6eca84
@ -1,5 +1,6 @@
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
from scipy import fftpack
|
||||
|
||||
fft = np.array(Image.open('fft.png').convert('L'))# / 255
|
||||
print(fft)
|
||||
|
@ -1,5 +1,6 @@
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
from scipy import fftpack
|
||||
|
||||
image = np.array(Image.open('image_4.png').convert('L'))# / 255
|
||||
print(image)
|
||||
@ -8,8 +9,16 @@ print(image)
|
||||
# fftpack.fftshift
|
||||
fft1 = (fftpack.fft2(image))
|
||||
|
||||
height, width = fft1.shape
|
||||
for x in range(width):
|
||||
fft1[height // 2, x] = np.median(fft1[:, x])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# save the image
|
||||
# np.log10
|
||||
plt.imshow(np.log10(abs(fft1)))
|
||||
plt.show()
|
||||
#plt.imsave('ifft1.png', fft1)
|
||||
#plt.imsave('ifft1.png', np.log10(abs(fft1)))
|
@ -47,8 +47,9 @@ fixedImage = interpolate_replace_nans(fft1, kernel)
|
||||
|
||||
figure, axes = plt.subplots(1, 2, sharex = True, sharey = True)
|
||||
|
||||
axes[0].set_title('Original FFT')
|
||||
axes[0].imshow(np.log10(originalFft1))
|
||||
axes[1].set_title('FFT with significant lines attenuated')
|
||||
axes[1].imshow(np.log10(fixedImage))
|
||||
#plt.imshow(np.log10(fixedImage))
|
||||
plt.show()
|
||||
#plt.imsave('fft.png', np.log10(fixedImage))
|
Loading…
x
Reference in New Issue
Block a user