【发布时间】:2015-11-22 02:31:44
【问题描述】:
我使用下面的代码在一个图中显示了 6 张图片。但是,输出包含一些不需要的区域。我想将图像裁剪为下图。这意味着我想裁剪它,以便 ROI 包含我的 6 张照片。谢谢大家
这是我的代码
%% read images in a cell array
imgs = cell(6,1);
for i=1:6
imgs{i} = imread( sprintf('AT3_1m4_%02d.tif',i) );
end
figure(1)
spaceH=0.01;spaceV=0.06;marTop=0.3;marBot=0.08;
padding=0.0;margin=0.0;marginL=0.0;
yoffset = 12;
set(gcf,'units','normalized','outerposition',[0 0 1 1])
% set(gcf,'color','w');
for i=1:6
subaxis(2,3,i,'SpacingHoriz', spaceH, ...
'SpacingVert',spaceV, 'PL',padding,'PR',padding,'mt',...
marTop,'mb',marBot,'ML',marginL,'MR',margin); title('Original');
imshow(imgs{i},[0 255], 'InitialMag',90, 'Border','tight');
xlb{i} = xlabel(['(' char(96+i) ')'],'FontSize', 16);
xp = get(xlb{i}, 'position');
xp(2) = xp(2) - yoffset; % update y-position
set(xlb{i}, 'position', xp); % assign new position
end
这是我现在的照片
我想得到输出
【问题讨论】:
标签: matlab matlab-figure imshow