Filtering in the frequency domain
Mostrar comentarios más antiguos
Hello everyone,
I am just getting into matlab and and working through some projects for digitam image processing. I wrote some matlab code to filter in the frequency domain but when I plot my image at multiple points I am getting issues from the expected results. I believe the issues are plotting and data type related and wanted to get some feedback on how to do things better.
I need to accomplish the following:
- Given an input f(x,y) of size M x N obtain the padding sizes P and Q. P = 2M, Q = 2N.
- Form a padded image fp(x,y) of size P x Q using zero padding.
- Center the image using fp(x,y) * (-1)^(x+y)
- Compute the DFT F(u,v) of the image from step 3.
- Construct a real symmetric filter transfer function H(u,v) of size P x Q with center at (P/2, Q/2).
- Form the product G(u,v)=G(u,v)*H(u,v) using element wise multiplication.
- Obtain the filtered image by computing the IDFT of G(u,v), and decenter the image. gp(x,y) = (real[IDFT{G(u,v)}])*(-1)^(x+y)
- Obtain the final filtered result g(x,y) of the same size as the input image by extracting the M x N region from the top, left quadrant of gp(x,y).
I have written the following code to filter my image and accomplish the steps above (thanks to lots of helpful answers on this website).
Question:
In my figure F_uv_dftImage I should see a periodic frequency spectrum. I can but I need to zoom in really close currently to see a tiny image. In the book im using they show this a lot more clearly. Am I using the wrong data types throughout my code (double) to get the results? Or am I just plotting these graphs in the wrong way to display the data? Any input would be great!
If you want to see my code please just message me directly.
1 comentario
Uzair Muhammad
el 31 de Mzo. de 2020
can you please share the code. thanks in advance
Email : uzairali398@gmail.com
Respuesta aceptada
Más respuestas (1)
alo halo
el 15 de Dic. de 2019
0 votos
I cannot find the direct message option. Can you please share your code with me?
Categorías
Más información sobre Blue en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!