How would you apply a 7 x 7 Laplacian of Gaussian filter on an image using the Fourier transform in MATLAB?

Technical Source
1 min readOct 17, 2019

--

I was struggling with my MATLAB Assignment help and then a good friend told me about MatlabSolutions.com website and they gave me the best Assignment help ever. I hope to always count on the quality and efficiency of your services.

  1. I = imread(‘moon.tif’);
  2. % Fourier filter must have equal size
  3. laplacian = zeros(size(I));
  4. % Placing our ‘Mexican hat’ in the left upper corner:
  5. laplacian(1:7,1:7) = […
  6. 0, 0,-1,-1,-1, 0, 0;…
  7. 0,-1,-3,-3,-3,-1, 0;…
  8. -1,-3, 0, 7, 0,-3,-1;…
  9. -1,-3, 7,24, 7,-3,-1;…
  10. -1,-3, 0, 7, 0,-3,-1;…
  11. 0,-1,-3,-3,-3,-1, 0;…
  12. 0, 0,-1,-1,-1, 0, 0]/48;
  13. % Shifting the filter’s center to the [1,1] index:
  14. laplacian = circshift(laplacian,-3*[1,1]);
  15. % Apply convolution theorem (multiply in Fourier domain)
  16. LapFilteredImage = real(ifftn(fftn(I).*fftn(laplacian)));
  17. % Show results:
  18. figure;
  19. subplot(1,2,1); imagesc(I); colormap gray;
  20. subplot(1,2,2); imagesc(LapFilteredImage); colormap gray;

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet