convolution

1 次查看(过去 30 天)
priya
priya 2011-12-9
Would anyone be able to explain what this command does to an image?
fx =conv2(image1,[-1 1;1 1],'same');

回答(1 个)

Wayne King
Wayne King 2011-12-9
Hi Priya, this implements bandpass filtering on an image.
If you have the Image Processing Toolbox, do:
h = [-1 1; 1 1];
freqz2(h);
You'll see that this is a bandpass filter (and as David Young correctly points out in his comment -- I incorrectly labeled it as highpass initially).
Contrast it with a lowpass filter:
Lo =[ -0.0106 0.0329 0.0308 -0.1870 -0.0280 0.6309 0.7148 0.2304];
Lo = Lo'*Lo;
freqz2(Lo);
Or a highpass filter
hi = [-0.2304 0.7148 -0.6309 -0.0280 0.1870 0.0308 -0.0329 -0.0106];
hi = hi'*hi;
freqz2(hi);
Thanks to David for his correction.
  1 个评论
David Young
David Young 2011-12-9
Doesn't it let through a lot of the DC component for a highpass filter? It's equal to 0.5 + [-1.5 0.5; 0.5 0.5] and while the second part of this is indeed highpass (but with a rather unusual asymmetrical form), having half the local mean added in surely makes it a kind of anisotropic bandpass, no?

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by