Bug with conv2
조회 수: 1 (최근 30일)
이전 댓글 표시
Here is a sample convolution performed with the built in function conv2. Unless I am completely crazy, this is not even close to the correct answer? Based on that image and kernel, I was expecting the output to be: [3 5 4; 9 0 6; 1 7 3]. Does anyone know of issues with conv2, or have insight to share?
댓글 수: 0
채택된 답변
Ajay Pattassery
2019년 10월 30일
편집: Ajay Pattassery
2019년 10월 30일
The above output from conv2 with the argument as 'valid' is expected.
If you are computing in the paper the kernel needs to be flipped and then slid over the image I.
The resultant kernel will be
0 0 0
0 0 0
0 0 1
Then the output will be,
3 7 8
7 2 9
3 8 0
댓글 수: 0
추가 답변 (1개)
Bruno Luong
2019년 10월 30일
The answer is correct. May be you expect the result with sliding sum with unflip kernel which is of course wrong.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 GPU Computing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!