How to apply a filter to an image?
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marco Pacifico
el 14 de Abr. de 2020
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284565/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284566/image.png)
0 comentarios
Respuesta aceptada
Spectro
el 14 de Abr. de 2020
Editada: Spectro
el 14 de Abr. de 2020
First you need to declare and read your picture:
img = imread('your_picture.bmp');
If you have already created matrices according to the assignment C - i. And ii. and that would be something like this:
I = [1/9 1/9 1/9;1/9 1/9 1/9;1/9 1/9 1/9];
II = [-1 -1 0;-1 0 1;0 1 1];
Finally, you want to use an imfilter() to filter image separately with created filters (matrices):
filtered_img1 = imfilter(img, I);
filtered_img2 = imfilter(img, II);
And if you want to show filtered images both at the same time:
subplot(121)
imshow(filtered_img1)
subplot(122)
imshow(filtered_img2)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!