Image filtering with zero padding
Afficher commentaires plus anciens
Hello, I need to implement imge filtering on a grayscale image with some mask, but the size of the output image is not equal to the input's. I tried to use zero-padding by using padarray, but it just puts both images in a 'frame' and do not resize the output.
x=imread('123.png'); % grayscale image
x_padded = padarray(x, [2 2]); % my 'zero-padding'
mask = [1 2 3; 4 5 6; 7 8 9]; % chosen mask
x1=x_padded(1:256,1:256);
y1=conv2(x1,mask);
M1=max(max(y1));
y1=255.*(y1./M1);
subplot(2,2,1);imshow(x_padded);title('Image')
subplot(2,2,2);imshow(uint8((y1)));title('Filtered Image')
Input and ouput images:

pls send help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Region and Image Properties dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!