Filtering in the frequency domain
이전 댓글 표시
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
Uzair Muhammad
2020년 3월 31일
can you please share the code. thanks in advance
Email : uzairali398@gmail.com
채택된 답변
추가 답변 (1개)
alo halo
2019년 12월 15일
0 개 추천
I cannot find the direct message option. Can you please share your code with me?
카테고리
도움말 센터 및 File Exchange에서 Blue에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!