图像太大,无法放入屏幕(MATLAB) [英] image is too big to fit in the screen (MATLAB)

查看:4279
本文介绍了图像太大,无法放入屏幕(MATLAB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这只是一个警告而且它不会影响代码..但我的问题是我需要以实际尺寸显示图像而不缩小..这是可能的 imshow 函数是否有任何参数可以执行此操作?

I know that it is just a warning and it will not affect the code .. but my problem is that I need to show the image in its real size without any zooming out .. is that possible in imshow function are there any parameters that do this?

谢谢大家

推荐答案

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

One solution that should work is to display the image and then change the axes limits so that there is one screen pixel for every image pixel:

%# 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])

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

Now you can select the hand (pan tool) and move the image around as needed.

这篇关于图像太大,无法放入屏幕(MATLAB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆