Cropping image and saving, for use in montage

1 次查看(过去 30 天)
Hello. I am trying to read 255 pictures, of a bone, and making a montage to display a full bone, with the code belov. Problem is that Matlab can't display the picture as it is, with the message "Warning: Image is too big to fit on screen; displaying at 4% ", dosent matter how much i rezise it. Does anybody know a solution?
folder_name = uigetdir;
ImagesToRead = dir(fullfile(folder_name, '*tif'));
ImageCell=cell(length(ImagesToRead),1);
for k = 1 : length(ImagesToRead)
images = (ImagesToRead(k).name);
ImageCell(k,:)={images};
end
i=imread('bone_705_001.tif');
figure(1)
imagesc (i)
pause(2)
im1 = montage(ImageCell, 'size', [15 15]);
im2 = imresize(im1, 0.01);
figure(2)
imagesc(im2)

回答(1 个)

Image Analyst
Image Analyst 2014-10-14
If you just want to display the whole image, don't worry about the warning - it's harmless. I can give you code to turn it off it you want:
% Turn off this warning "Warning: Image is too big to fit on screen; displaying at 33% "
warning('off', 'Images:initSize:adjustingMag');
If you want to display at full size, pixel for pixel, that's a lot harder. You'll have to create an imscrollpanel. I attach a demo for that, but honestly you'll probably think it's so complicated that you won't implement it. Nonetheless that's the Mathworks recommended method - my demo actually started out with code they sent me.

Community Treasure Hunt

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

Start Hunting!

Translated by