how to combine the blocks

4 visualizaciones (últimos 30 días)
Sharen H
Sharen H el 20 de Jul. de 2013
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

Respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by