Borrar filtros
Borrar filtros

convolution

1 visualización (últimos 30 días)
priya
priya el 9 de Dic. de 2011
Would anyone be able to explain what this command does to an image?
fx =conv2(image1,[-1 1;1 1],'same');

Respuestas (1)

Wayne King
Wayne King el 9 de Dic. de 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 comentario
David Young
David Young el 9 de Dic. de 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?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by