split image to 16*16 blocks and show it

1 visualización (últimos 30 días)
tomy gn
tomy gn el 21 de Mayo de 2018
Comentada: Samia Nushrat el 28 de Mzo. de 2022
hi i want split image to 16*16 blocks and show it nearly like this image but 16*16 please help me

Respuestas (1)

Ameer Hamza
Ameer Hamza el 22 de Mayo de 2018
You will need this FEX::MAT2TILES to make things easier. Download it and place in your MATLAB path. Then use the following code to draw the image blocks
I = imread('filename');
rows = 5; % define how many rows of block
cols = 4; % define how many cols of block
sizeI = size(I);
blocks = mat2tiles(I, ceil(sizeI(1:2)./[rows cols]))';
for i = 1:rows*cols
subplot(rows, cols, i);
imshow(blocks{i});
end
  3 comentarios
Ameer Hamza
Ameer Hamza el 22 de Mayo de 2018
You need to download the package from this link: https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles--divide-array-into-equal-sized-sub-arrays and place it in MATLAB path. I mentioned this FEX submission in my answer.
Samia Nushrat
Samia Nushrat el 28 de Mzo. de 2022
How can I get back the original image after split?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by