Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
HOW TO READ THE VALUES IN PARTICULAR BLOCK WHEN THE IMAGE IS CONVERTED INTO CELLS BY USING MAT2CELL
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
clear all;
im=imread(uigetfile('*.*'));
im=imresize(im,[200 200]);
im=mat2cell(im,[50 50 50 50],[25 25 25 25 25 25 25 25],3);
.i have taken the rgb image.now i have to read the first block i.e.,50 rows, 25 columns.how to seperately read the first block for adding another image to the first block of same size
0 comentarios
Respuestas (1)
Image Analyst
el 11 de Abr. de 2014
Just use a nested for loop
[rows, columns] = size(im);
for col = 1 : columns
for row = 1 : rows
thisBlock = im{row, col];
% Now do whatever you want with this 2D array of numbers.
% For example
thisBlock = (double(thisBlock) + double(referenceBlock) / 2; % or whatever...
end
end
2 comentarios
Image Analyst
el 11 de Abr. de 2014
Here's some help on resolving the error: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/
Once you view that, you'll probably notice that you are overwriting your whole cell array with the contents of just one block of it added to the carry image. So now you've destroyed im. It's no longer a cell array!
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!