imfilter
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi guys,
I'm confused by the optimal parameters, 'corr' and 'conv'.
Assuming there is a matrix A = [1 2; 8 9; 0 8], a filter f = [-1 -1; 2 2; -1 -1];
It seems that 'corr' and 'conv' will make same result.
I kind of understand 'conv'. It's convolution for the concrete case. But for 'corr', I'm confused. Does it mean the function 'corr2'? I have checked. it seems no.
Can you guys give an example to explain it?
Thanks,
Zhong
댓글 수: 0
채택된 답변
Wayne King
2012년 5월 2일
Zhang, the difference is that there is a rotation of the kernel by 180 degrees (pi radians) between the two.
So for:
h = [1 2 3
4 5 6
7 8 9];
and
h1 = [9 8 7
6 5 4
3 2 1];
x = randn(20,20);
isequal(imfilter(x,h,'corr'),imfilter(x,h1,'conv'))
returns a 1.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!