图像太大,无法放入屏幕(MATLAB)

Oma*_*ama 5 matlab plot image zoom

我知道它只是一个警告,它不会影响代码..但我的问题是,我需要显示其实际大小的图像,没有任何缩小..是否可能在imshow功能有任何参数,这样做?

谢谢你们

Jon*_*nas 3

一种可行的解决方案是显示图像,然后更改轴限制,以便每个图像像素都有一个屏幕像素:

%# read an image and make it large
img = imread('autumn.tif');
img = repmat(img,[10,10]);

%# turn off the warning temporarily, we're going to fix the problem below
%# Note that in R2011b, the warning ID is different!
warningState = warning('off','Images:initSize:adjustingMag');
figure
imshow(img)
warning(warningState);


%# get axes limits in pixels
set(gca,'units','pixels')
pos = get(gca,'position')

%# display the top left part of the image at magnification 100%
xlim([0.5 pos(3)-0.5]),ylim([0.5 pos(4)-0.5])
Run Code Online (Sandbox Code Playgroud)

现在您可以选择手(平移工具)并根据需要移动图像。