Azzera filtri
Azzera filtri

convolution

1 visualizzazione (ultimi 30 giorni)
priya
priya il 9 Dic 2011
Would anyone be able to explain what this command does to an image?
fx =conv2(image1,[-1 1;1 1],'same');

Risposte (1)

Wayne King
Wayne King il 9 Dic 2011
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 Commento
David Young
David Young il 9 Dic 2011
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?

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by