The Convolution Theorem in 2D

Hello,
I have two images A and B with different size.
I want to show that:
fft2(conv2(A,B))
is equal to
fft2(A).*fft2(B)
but I get different outputs.
what is the problem?
Thanks.

답변 (3개)

Matt J
Matt J 2021년 5월 17일
편집: Matt J 2021년 5월 17일

1 개 추천

The problem is that you need to zero-pad,
A=rand(10); B=rand(10);
szA=size(A);
szB=size(B);
szFull=szA+szB-1;
result1 = fftn(A,szFull).*fftn(B,szFull);
result2= fftn(conv2(A,B,'full'));
difference=norm(result1-result2,'inf')
difference = 1.0735e-12
Jonas
Jonas 2021년 5월 17일
편집: Jonas 2021년 5월 17일

0 개 추천

i suggest you have a look onto file exchange, there is an example called 2d convolution theorem
https://de.mathworks.com/matlabcentral/fileexchange/60897-2d-convolution-theorem

댓글 수: 1

Paz INBAR
Paz INBAR 2021년 5월 17일
Thank you for your answer.
I ran this file but I got different images in R ( I*M ) and in R ( ifft(F X W) ) , according to names of the images in this file.
(which are the both sides of the convolution theoren).

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

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 19일

0 개 추천

Note that the sizes of A and B must match. In your inserted image array, sizes of A and B must have differed.

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

제품

질문:

2021년 5월 16일

답변:

2021년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by