Question: In [ 1 4 ] : # MN _ 2 _ Fourier _ Transfors. ipnybinport numpy as np Inport pylab import matplotlib.pyplot as plt from
In : # MNFourierTransfors. ipnybinport numpy as np
Inport pylab
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
wh
shape w h
im Image.newRGB w h
ing InageDraw.Drawim
img.ellipseshape fill "red", outline "blue"
pylab.imshowim
pylab.titleCircle
pylab.show
im Image.newRGBhmathrm
ing ImageDraw.Drawim
ing.rectangleshape fill "yellow", outline "purple"
pylab.inshowim
pylab.titleBox
pylab.show
f pltfigure
faddsubplot
plt inshownproteim
faddsubplot
plt inshownprotein
pltshowblockTrue
Task :
Perform a Fourier analysis on the two above images. The program should do the following:
draws separate images
takes the D discrete Fourier transform of one of the images HINT: using the numpy package, look at fft and fftshift
applies a gaussian filter to the image
takes the inverse transform of the image HINT: using the numpy package, look at ifft
displays the blurred image
There are many ways you can attempt each of these steps, so I would recommend doing some research online.
The SciPy documentation on the scipy website is helpful if you're unsure where to start.
Gaussian Filter: A Gaussian Filter is used in reducing noise in the image, and also the details of the image. The Gaussian function based on the size of
standard deviation is defined as:
where is the distance from the origin in the horizontal axis, is the distance from the origin in the vertical axis, and is the standard deviation of the
Gaussian distribution. For the purposes of this lab, you can experiment which different values of If you are unsure, try a value of Your output should look
something like this for the cross image shown above from left to right, D discrete Fourier transform, gaussian filter applied, and the final blurred image:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
