回答編集履歴
1
コードの修正
test
CHANGED
@@ -46,9 +46,7 @@
|
|
46
46
|
|
47
47
|
blur_fshift = np.fft.fftshift(f)
|
48
48
|
|
49
|
-
abs_blur_fshift = np.abs(blur_fshift)
|
50
|
-
|
51
|
-
magnitude_spectrum1 = np.log(abs
|
49
|
+
magnitude_spectrum1 = np.log(np.abs(blur_fshift))
|
52
50
|
|
53
51
|
plt.imshow(blur, cmap = 'gray')
|
54
52
|
|
@@ -78,9 +76,7 @@
|
|
78
76
|
|
79
77
|
imput_fshift = np.fft.fftshift(imput_fshift)
|
80
78
|
|
81
|
-
abs_imput_fshift = np.abs(imput_fshift)
|
82
|
-
|
83
|
-
magnitude_spectrum2 = np.log(abs
|
79
|
+
magnitude_spectrum2 = np.log(np.abs(imput_fshift))
|
84
80
|
|
85
81
|
plt.imshow(imput_img, cmap = 'gray')
|
86
82
|
|
@@ -108,9 +104,7 @@
|
|
108
104
|
|
109
105
|
rekka_f = np.fft.fftshift(imput_fshift*blur_fshift)
|
110
106
|
|
111
|
-
abs_rekka_f = np.abs(rekka_f)
|
112
|
-
|
113
|
-
magnitude_spectrum12 = np.log(abs
|
107
|
+
magnitude_spectrum12 = np.log(np.abs(rekka_f))
|
114
108
|
|
115
109
|
rekka_img = np.fft.ifft2(imput_fshift*blur_fshift).real
|
116
110
|
|