필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Jason
Jason 2024년 4월 18일
답변: Jason 2024년 4월 18일
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개)

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by