What does this Digital filter actually do? and what is it called?

I am using a filter defined by Matrix [1 1 1 1 1;1 2 2 2 1; 1 2 4 2 1; 1 2 2 2 1; 1 1 1 1 1]; on a 2 D image with filter2. I would like to know what is the name of the filter if it has one and what exactly it does to the image?

 Respuesta aceptada

It is a 2D FIR filter: I am not certain it has any other name.
To see what it does, plot its results —
H = [1 1 1 1 1;1 2 2 2 1; 1 2 4 2 1; 1 2 2 2 1; 1 1 1 1 1];
A = ones(25);
Y = filter2(H,A,'full');
figure
surf(Y)
.

4 comentarios

I am using the option "same" and applying it to a 2-D gray scale image. What is it supposed to do I am not sure which is what I want to find out. Thanks for some clarification anyways.
Try it with an actual image to see the result.
Using a 3D impulse produces:
H = [1 1 1 1 1;1 2 2 2 1; 1 2 4 2 1; 1 2 2 2 1; 1 1 1 1 1];
A = zeros(25);
A(312) = 1;
Y = filter2(H,A,'same');
figure
surfc(Y)
colormap(turbo)
colorbar
title('Inpulse Response')
figure
surfc(abs(fft2(Y)))
colormap(turbo)
colorbar
title('Fourier Transform Of The Impulse Response')
figure
contourf(abs(fft2(Y)), 50)
colormap(turbo)
colorbar
title('Fourier Transform Of The Impulse Response')
.
Thanks for all your efforts. So if i understand it correctly, then my 2-D gray scale image, the lighter pixels get more light and amplified compared to the darker ones and also because it is 5x5 matrix filter, it also smooths out somewhat any kind of unevenness in the gray scale values. Right?
My pleasure!
I cannot determine what it does to your image with respect to light or dark pixels. It appears to emphasize the centre pixels and attenuate those outisde its specified area.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2021b

Preguntada:

el 19 de Mayo de 2022

Comentada:

el 21 de Mayo de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by