Recombine cell arrays to produce a new image
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I've split an image into blocks
for testing ive skipped all odd blocks
now how to i recombine all cells to create the a new picture with all the cells
plotIndex = 1;
numPlotsR = size(Cellarray, 1);
numPlotsC = size(Cellarray, 2);
for r = 1 : numPlotsR
for c = 1 : numPlotsC
if bitget(c,1)
fprintf('plotindex = %d, c=%d, r=%d\n', plotIndex, c, r);
else
fprintf('noooooo\n')
end
% Plot consecutively.
if bitget(c,1)
subplot(numPlotsR, numPlotsC, plotIndex);
plotIndex = plotIndex +1
continue;
end
% Extract the numerical array out of the cell
rgbBlock = Cellarray{r,c};
imshow(rgbBlock); % Could call imshow(ca{r,c})
[rowsB, columnsB, numberOfColorBandsB] = size(rgbBlock);
caption = sprintf('B#%d/%d', ...
plotIndex, numPlotsR*numPlotsC);
title(caption);
drawnow;
% Increment the subplot to the next location.
plotIndex = plotIndex + 1;
end
end
2 Kommentare
Image Analyst
am 7 Dez. 2020
What is Cellarray? You forgot to include the first part of your program!
To properly indent your code, back in MATLAB (not here), type control-a (to select all) then type control-i (to properly indent). Now you can copy and paste the code here and not have it look like a total mess.
Antworten (1)
KALYAN ACHARJYA
am 30 Nov. 2020
Bearbeitet: KALYAN ACHARJYA
am 30 Nov. 2020
"now how to i recombine all cells to create the a new picture with all the cells"
cell2mat
Siehe auch
Kategorien
Mehr zu Red finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!