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

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 3일

0 개 추천

댓글 수: 3

Iman Ansari used the function
res = conv2(A,M,'valid');
for computtion.
I need to implement convolution without using conv2
Ameer Hamza
Ameer Hamza 2020년 4월 3일
See the calculation of res2. That code compares built-in convolution with for loop.
Ok. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (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