Code covered by the BSD License  

Highlights from
Block Division using cell

image thumbnail
from Block Division using cell by Suraj Kamya
Using cell data type one can effectively breaks the 2D/3D data in to required no. of blocks.

I=recom_blocks(B)
function I=recom_blocks(B)
% recom_blocks functions combines the 8*8 blocks back to one image
% B = output of the function blocks is input for recombination
% I = Recombined image as output

i=[]; j=[]; data=[]; count=0;
embimg1={}; % Changing complete row cell of 4096 into 64 row cell 
for j=1:64:4096
    count=count+1;
    for i=j:(j+63)
        data=[data,B{i}];
    end
    embimg1{count}=data;
    data=[];
end

% Change 64 row cell in to particular columns to form image
i=[]; j=[]; data=[]; 
embimg=[];  % final combined image 
for i=1:64
    embimg=[embimg;embimg1{i}];
end
I=embimg;

Contact us