Why do i get different results when i perform convolution with different ways?

Hello ,
i have an image 30x30 and i want to perform convolution with a filter 9x9 using 2 methods . Firstly , i need to perform the convolution using conv2() and then using ifft2(fft2(image)*fft2(filter)) . Can someone explain why in the first case i get back a 38x38 result as expected ( i am aware that the result after the convolution is length(image+filter-1)) but in the second i get back a 30x30 result? Isn't supposed to be the same procedure ?

 採用された回答

Matt J
Matt J 2020 年 12 月 10 日
編集済み: Matt J 2020 年 12 月 10 日

0 投票

No, it's not the same procedure. conv2 performs linear convolution, wherease your fft method performs cyclic convolution. See also,

3 件のコメント

Gn Gnk
Gn Gnk 2020 年 12 月 10 日
So , is it possible to compare these 2 results ?Let's say by using immse() (but immse returns an error because the results from the 2 methods have not the same size ) .I am really stuck at this point , because in my assignment i have to compare 2 methods that appear to be different .
Matt J
Matt J 2020 年 12 月 10 日
The link I gave you discusses how to compare them.
Gn Gnk
Gn Gnk 2020 年 12 月 10 日
Thank you a lot ,it really helped me !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

質問済み:

2020 年 12 月 10 日

コメント済み:

2020 年 12 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by