Add 1
to np.log10
argument
This commit is contained in:
parent
4d9e8bead1
commit
7a002f8b0d
@ -9,7 +9,7 @@ image = np.array(Image.open('circle.png').convert('L'))# / 255
|
||||
fft1 = fftpack.fftshift(fftpack.fft2(image))
|
||||
|
||||
# save the image
|
||||
toDisplay = np.log10(abs(fft1))
|
||||
toDisplay = np.log10(1 + abs(fft1))
|
||||
plt.imshow(toDisplay)
|
||||
plt.show()
|
||||
plt.imsave('ifft1.png', toDisplay)
|
@ -61,8 +61,8 @@ plt.suptitle('Attenuating FFT significant lines')
|
||||
axes[0].set_title('Original FFT')
|
||||
#originalFft1Abs = abs(originalFft1)
|
||||
#minValue = np.min()
|
||||
firstImage = np.log10(abs(originalFft1))
|
||||
secondImage = np.log10(abs(fixedImage))
|
||||
firstImage = np.log10(1 + abs(originalFft1))
|
||||
secondImage = np.log10(1 + abs(fixedImage))
|
||||
images = [firstImage, secondImage]
|
||||
vMin = np.min(images)
|
||||
vMax = np.max(images)
|
||||
@ -71,7 +71,7 @@ axes[1].set_title('FFT with significant lines attenuated')
|
||||
axes[1].imshow(secondImage, vmin = vMin, vmax = vMax)
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
#plt.imsave('fft.png', np.log10(fixedImage))
|
||||
#plt.imsave('fft.png', np.log10(1 + fixedImage))
|
||||
|
||||
figure, axes = plt.subplots(1, 2, sharex = True, sharey = True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user