how to do convolution without commands
조회 수: 5 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 4월 3일
See the answer by Iman Ansari on this question: https://www.mathworks.com/matlabcentral/answers/75073-built-in-2d-convolution-vs-for-loop-convolution-differences
댓글 수: 3
Ameer Hamza
2020년 4월 3일
See the calculation of res2. That code compares built-in convolution with for loop.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!