The Convolution Theorem in 2D
Ältere Kommentare anzeigen
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.
1 Kommentar
Paz INBAR
am 17 Mai 2021
Antworten (3)
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')
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 Kommentar
Paz INBAR
am 17 Mai 2021
Sulaymon Eshkabilov
am 19 Mai 2021
0 Stimmen
Note that the sizes of A and B must match. In your inserted image array, sizes of A and B must have differed.
Kategorien
Mehr zu Images finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!