I reshaped the image elements 256*256 into 16*1 linear array using the following code. There is 16 linear arrays in a variable (ex:tv). Now i need to retrieve the first array of variable (tv). ie, i need tv(1), tv(2)... tv(16). Please say the code.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I=imread('cameraman.tif'); I=double(I); Im=size(I); %find the size of the image [nr nc nd]=size(I); % Divide into blocks disp(nr); disp(nc);
% Divide into blocks m=64; n=64; row=1; column=1; i=1; j=1; sum=0; count=0; nnn=1; er1=0; for i=1:4:16
for j=1:4:16
block=I(i:i+3,j:j+3);
disp(block)
T = rand(16,16); % Size of all your vectors, concatenated
Tr = reshape(T,[4,4,16])
%convert 4X4 into 16X1 column vector
tv=reshape(block,16,1);
disp(tv)
count=count+1
column=column+4;
end
row=row+4;
end
0 comentarios
Respuestas (1)
Image Analyst
el 20 de Feb. de 2016
I didn't delve into your code but I see you creating a 16x1 vector in it:
tv=reshape(block,16,1);
so what's the problem?
4 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!