matlab - How to create block image? -
i have 2000 images, size of each xi=320*512 double (i=1:1:2000). want regard each image 1 block, there 2000 blocks, , put them in 1 big image. each block there label corresponding it, label ranges 1 10. question how put 2000 images big block images label each block described above?
i have 2000 images this. can tell me how put kind of images blocks?
my comment incorrect, reshape
not solve problem. however, did use reshape
create example array of images.
% replace these 320, 512, , 2000. nx = 2; ny = 3; nz = 4; % nz images, each of size nx ny images = reshape(1: nx * ny * nz, nx, ny, nz) % put each image larger image composed of n1 * n2 blocks n1 = 2; n2 = 2; image = zeros(n1 * nx, n2 * ny); % note, nz == n1 * n2 must true iz = 0; i1 = 1: n1 i2 = 1: n2 iz = iz + 1; image((i1 - 1) * nx + 1: i1 * nx, (i2 - 1) * ny + 1: i2 * ny) ... = images(:, :, iz); end end image
this creates big block image correctly. may want change inner/outer order of loops column-major ordering instead of row-major ordering.
like paisanco, unsure want labels.
Comments
Post a Comment