Convolution theorem. Fourier transform.

조회 수: 2 (최근 30일)
Dimani4
Dimani4 2014년 12월 6일
댓글: Matt J 2014년 12월 7일
Hey ppl,
I have a question about convolution and Fourier transform. I have Final picture and initial picture. I know that the final picture results as convolution between the initial and something else, i.e. final picture=initial picture(*)X. All we know that F{final picture}=F{initial picture}F{X}=>F{X}=F{final picture}/F{initial picture}; then X=F{X}^(-1). Pretty easy but I got a blank picture after that manipulations. Take a look part of my code:
FFT_picture=fft2(picture); %?
FFT_hole=fft2(hole); %?
FFT_X=FFT_picture./FFT_hole;
X=ifft2(FFT_X);
what I do wrong?
I've attached two files. The first one is the initial picture and the second one is the final picture.
Thank you.
  댓글 수: 1
Matt J
Matt J 2014년 12월 6일
I've attached two files. The first one is the initial picture and the second one is the final picture.
If you attach "picture" and "hole" in a .mat file instead, it will be easier for people to repeat your test.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2014년 12월 6일
편집: Matt J 2014년 12월 6일
Your procedure won't work if FFT_hole has some pixels containing zero (or nearly zero). If that happens then your calculation of FFT_X will have a divide-by-zero situation and give NaNs and/or Infs in those pixels. Passing that through ifft2() will just yield junk.
You might want to look at deconvreg() instead.
  댓글 수: 2
Dimani4
Dimani4 2014년 12월 7일
No. It doesnt work. It gave me just a number. Secondly this function doesnt work with matrices, only with vectors. So I reshape it to vectors and added some numbers instead zeros. My pictures contain zeros. I wonder is any body didnt encounter with such a problem.
Matt J
Matt J 2014년 12월 7일
You're using it wrong somehow. It's an Image Processing Toolbox function. It's specifically meant for image deconvolution. There is an example in its documentation.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by