imfilter and filter2

Hi guys,
Are imfilter and fiter2 the same for two dimensional array?
I did a lot of experiment. It seems they are the same. But filter2 are much faster than imfilter
Thanks,
Zhong

 채택된 답변

Wayne King
Wayne King 2012년 5월 2일

0 개 추천

Yes, they are the same in some instances:
h = 1/100*ones(10,10);
x = randn(20,20);
y = filter2(h,x);
y1 = imfilter(x,h);
max(abs(y(:)-y1(:)))
but imfilter() gives more options to specify boundary conditions for example and whether to rotate the kernel or not -- 'corr' vs 'conv'

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Chemistry에 대해 자세히 알아보기

질문:

2012년 5월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by