Matrix Zero padding for filter (image processing)
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a matrix and size 5x5. I want to zero padding between each row and column. Thus, result matrix is 9x9 after zero padding. I'll use this in wavelet zero-padding. Thanks!!
matrix = ones(5)
result_matrix = [1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1]
댓글 수: 0
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2016년 5월 14일
matrix = ones(5)
n=size(matrix,1)
result_matrix=zeros(2*n-1)
result_matrix(1:2:end,1:2:end)=matrix
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!