spliting image to 16x16 blocks

2 visualizaciones (últimos 30 días)
nadia naji
nadia naji el 4 de Mzo. de 2013
hi i have an image with size 320x240 i want to split it to 16x16 blocks but i don't use for loop. i don't process these blocks and i only save theme that after 30 frame i do LBP 3d on it? can you help me

Respuestas (2)

Jan
Jan el 4 de Mzo. de 2013
SplitImage = reshape(Image, 16, 20, 16, 15);
SplitImage = permute(SplitImage, [1, 3, 2, 4]);
SplitImage = reshape(SplitImage, [16, 16, 300]);

Walter Roberson
Walter Roberson el 4 de Mzo. de 2013
SplitImage = mat2cell(Image, 16 * ones(1, size(Image,1) / 16), 16 * ones(1, size(Image,2) / 16), size(Image,3));
  3 comentarios
nadia naji
nadia naji el 4 de Mzo. de 2013
thanks for your help i use this function
Matt J
Matt J el 4 de Mzo. de 2013
Glad it does what you want, though if speed was your goal, Jan's method is about 4 times faster.

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