November 2018
Intermediate to advanced
492 pages
12h 19m
English
In this example, we will first add some periodic (sinusoidal) noise to the parrot image to create a noisy parrot image (this can happen because of interference with some electrical signal) and then observe the effect of the noise in the frequency domain of the image using the following code block:
from scipy import fftpackpylab.figure(figsize=(15,10))im = np.mean(imread("../images/parrot.png"), axis=2) / 255print(im.shape)pylab.subplot(2,2,1), pylab.imshow(im, cmap='gray'), pylab.axis('off')pylab.title('Original Image')F1 = fftpack.fft2((im).astype(float))F2 = fftpack.fftshift( F1 )pylab.subplot(2,2,2), pylab.imshow( (20*np.log10( 0.1 + F2)).astype(int), cmap=pylab.cm.gray)pylab.xticks(np.arange(0, ...Read now
Unlock full access