how to combine the blocks
조회 수: 4 (최근 30일)
이전 댓글 표시
clc
clear all
x=
[2 3 4 5
2 3 4 5
1 2 3 4
1 2 3 4]
[r c]=size(x);
bs=2; % Block Size (8x8)
nob=(r/bs)*(c/bs); % Total number of 8x8 Blocks
% Dividing the image into 2x2 Blocks
kk=0;
for i=1:(r/bs)
for j=1:(c/bs)
Block(:,:,kk+j)=x((bs*(i-1)+1:bs*(i-1)+bs),(bs*(j-1)+1:bs*(j-1)+bs));
BlockM=Block(:,:,kk+j);
BlockMM=mean(BlockM(:));
Block(:,:,kk+j)=BlockMM
end
kk=kk+(r/bs);
end
i have divided the matrix into blocks of 2x2 size and i have stored it in Block(:,:,i) separately. can any one please help me to combine into original matrix thanks in advance
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!