how to do convolution without commands

I=img;
b=rgb2gray(I); [Gx,Gy]=imgradientxy(b); figure();
[Gmag, Gdir] = imgradient(Gx,Gy);
gx=[-1 0 1; -2 0 2; -1 0 1];
gy=transpose(gx);
gi=gray2ind(b);
Fx=conv2(double(b),gx,'same')
In the above coding how to do convolution without conv2

 采纳的回答

3 个评论

Iman Ansari used the function
res = conv2(A,M,'valid');
for computtion.
I need to implement convolution without using conv2
See the calculation of res2. That code compares built-in convolution with for loop.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by