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

3 次查看(过去 30 天)
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

采纳的回答

Jason
Jason 2024-4-18
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by