I created a code which does filtering with convulution but it gives an error
Mostrar comentarios más antiguos
A = imread('lena.jpg');
F = uint8([-1 -1 -1;0 0 0;1 1 1]);
B = uint8(padarray(A,[1 1]));
Output = uint8(zeros(size(A)));
for i = 1:size(B,1)-2
for j = 1:size(B,2)-2
X = B(i:i+2,j:j+2).*F;
Output(i,j) = sum(X(:));
end
end
imshow(Output)
but it doesn't work correctly. What is my mistake?
1 comentario
Rik
el 27 de Jul. de 2021
Why do you want to replace the efficient convolution with a nested loop?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Filtering en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
