mawais
Junior Member level 2
Hello I am trying to do 2D convolution in MATLAB.
its easier to do it with conv2 function. I was wondering if I could do it like this.
computing convolution in x-direction and then in y-direction using linear convolion function conv in MATLAB, and finally combining them to obtain a same result as that of conv2.
Please reply if it is possible then how to combine two convolution matrices generated from those in x and y directioins.
Best regards,
Awais.
Added after 51 minutes:
Can anyone explain how to get a 3x3 matrix same as that resulted from conv2
its easier to do it with conv2 function. I was wondering if I could do it like this.
computing convolution in x-direction and then in y-direction using linear convolion function conv in MATLAB, and finally combining them to obtain a same result as that of conv2.
Please reply if it is possible then how to combine two convolution matrices generated from those in x and y directioins.
Best regards,
Awais.
Added after 51 minutes:
Code:
a=magic(2);
b=magic(2);
c=conv2(a,b);
c1=conv(a(1,:),b(1,:));
c2=conv(a(2,:),b(2,:));
c3=conv(a(:,1),b(:,1));
c4=conv(a(:,2),b(:,2));
Can anyone explain how to get a 3x3 matrix same as that resulted from conv2