Convolution using convn does not give expected result
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lieke Pullen
am 14 Jan. 2022
Bearbeitet: Matt J
am 14 Jan. 2022
Dear all,
I am trying to use a kernel with values which should decrease the values in 3D array that you use. However, when I use convn and 'same', this leads to a plateau with a much higher value as the maximum value of the kernel. Am I using the wrong way to calculate the convolution, or what is happening?
load('s.mat')
A=ones(110,110,110);
C_con=convn(A,s_full,'same');
figure; surf(C_con(:,:,50));

0 Kommentare
Akzeptierte Antwort
Matt J
am 14 Jan. 2022
Bearbeitet: Matt J
am 14 Jan. 2022
There's no reason to think convolution in general won't increase the values. As a trivial example:
A=ones(5);
B=convn(A,2,'same')
4 Kommentare
Matt J
am 14 Jan. 2022
Bearbeitet: Matt J
am 14 Jan. 2022
You seem to be under the impression that convn(A,B) should always have the shape of B, but convolution is commutative, i.e., convn(A,B)= conv(B,A), so how can the shape of the result have more to do with B than with A? I could just as easily view A as the kernel here, so shouldn't the shape follow A rather than B?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
