Manually Create a montage of images collected in a zig zag pattern

2 vues (au cours des 30 derniers jours)
Jason
Jason le 18 Avr 2024
Réponse apportée : Jason le 18 Avr 2024
Hello, I have a set of 40 (100x100 pixels) images that I have in an 1D cell array ROIC_Array (size(ROIC_Array) = 1 x 40)
I collected them by scanning in a zig zag motion i.e. the 1st 10 images are left to right (x direction), then the next 10 images are right to left and stepped (in y). I want to create a montage of them stiched together. I know imTile exists, but it lloses resolution so I want to create the montage manually. Even before I get into reversing every other row, I can't get the basic montage working
% Create Montage
Montage=reshape(ROIC_Array,4,10); % want 4 rows, 10 columns
IM2=[]; IMrow=[];
% Vertcat rows
for i=1:4
IMrow=Montage(i,:)
IM2=vertcat(IM2,IMrow);
end
size(IM2)
figure
ax=subplot(1,1,1);
myImagesc(ax,IM2) % My version of Imagesc that uses Gray Colourmap and removes all ticks

Réponse acceptée

Jason
Jason le 18 Avr 2024
Seems I didn't need the reshape. This works, not sure its the most elegant way
%Now create Montage
IMrow=[];
IMout=[];
ct=0;
for j=1:4 %rows
for i=1:10 % cols
ct=ct+1
IM=ROIC_Array{ct}
IMrow=horzcat(IMrow,IM);
end
if rem(j,2)==1 %If ODD
% Do nothing
else
IMrow=fliplr(IMrow);
end
IMout=vertcat(IMout,IMrow);
IMrow=[];
end
figure
ax=subplot(1,1,1);
myImagesc(app,ax,IMout);

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by