Image filtering with zero padding
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Region and Image Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!