how to do convolution without commands

조회 수: 5 (최근 30일)
Sivakumar Rajagopal
Sivakumar Rajagopal 2020년 4월 3일
댓글: Sivakumar Rajagopal 2020년 4월 6일
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일
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 4월 3일
See the calculation of res2. That code compares built-in convolution with for loop.
Sivakumar Rajagopal
Sivakumar Rajagopal 2020년 4월 6일
Ok. Thanks.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by