Convolution with Delta Function
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a 122*384 sized grid for which I am calculating the euclidean distance function from the origin situated at a corner of my grid. The image representation of the same can be seen here http://i40.tinypic.com/6pazwi.jpg.
I want to convolve it with a delta function of the same size having a value of 1 at (1,200) and zero else where. So i am using the following code
y=ifft2(fft2(grid).*fft2(delta))
imagesc(y)
What is happening to the left part of the image? If I am right I should have an output like this http://i40.tinypic.com/28aq7hd.jpg
Please tell me where I am going wrong? Any help will be very much appreciated.
0 comentarios
Respuestas (1)
Image Analyst
el 5 de Feb. de 2012
fft2 puts the origin at the upper left and then positive frequencies go to the lower right from there, and negative frequencies to the upper left from the bottom right pixel. Use fftshift() and I think you'll solve that problem.
By the way, convolving with a delta function should give you the same as your input image, except for some quantization errors perhaps.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!