Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
display large image with interpolation??

Subject: display large image with interpolation??

From: the phaseshift

Date: 18 Oct, 2012 09:53:07

Message: 1 of 2

Hi everyone

I'm trying to display an image much larger than my screen in a figure, and afterwards I'm displaying a vector line plot on top of the image, all at full-resolution.

The image is (as expected) resized by MATLAB to fit the screen ("Warning: Image is too big to fit on screen; displaying at 13%"). This is normal and fine.
The problem is: it's ugly. That's because the image is displayed using nearest-neighbor interpolation by default (at least that's how it looks).

I can't find any way to display the image *nicely* (e.g. bilinear interpolation) without resizing it first (imresize). "imresize" does display the image nicely if I size it to the current figure size and set the interpolation to "bilinear", but as I said - I can't do this because I need to keep it at full size for the next step.

I'm using imshow or imagesc to display the image, but neither seem to have an "interpolate" property.

Is it possible to display a large image in a figure *without resizing*, and somehow displayed using bilinear interpolation? (or at least not the noisy-looking nearest-neighbor interpolation it seems to be using by default)

It surprises me that this isn't easy; after all, just open a large image in almost any image editing program/viewer, and it's displayed on the screen with some kind of smoothing operation (probably often bilinear/cubic interpolation) by default, because otherwise it looks ugly...so why does MATLAB make it a fight to get a decent default image display to a figure, despite the fact that e.g. imshow is part of the image processing toolbox?

Thanks for any suggestions!

Subject: display large image with interpolation??

From: Bruno Luong

Date: 18 Oct, 2012 12:43:08

Message: 2 of 2

"the phaseshift" <thephaseshift@hotmail.com> wrote in message <k5oji3$t56$1@newscl01ah.mathworks.com>...
> Is it possible to display a large image in a figure *without resizing*, and somehow displayed using bilinear interpolation? (or at least not the noisy-looking nearest-neighbor interpolation it seems to be using by default)

You can't fit an elephant to a matchbox, can you?

And one point somebody has to do the interpolation (MATLAB, graphics card, ...) in order to display an image that is larger than the screen. If you believe that the image which fits on the screen and is not apparently resized but somehow miraculously shrunk, try to think again.

There might be or might be not a way to do what you ask.

But if you want to do it nicely than what has been offered, why not serve yourself by manually resizing it?

Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us