How do I change the resolution of an image produced by imagesc?

26 vues (au cours des 30 derniers jours)
Ross Brain
Ross Brain le 10 Avr 2015
Commenté : Ross Brain le 11 Avr 2015
How can I change the resolution of the image part of the figure produced by imagesc? I was going to try using imresize but I can't figure out how to make it work. I'm trying to purposefully reduce the quality of a data set as part of a simulation.
  1 commentaire
Ross Brain
Ross Brain le 11 Avr 2015
For those curious what I'm doing, I'm using data from the Leiden/Dwingeloo sky survey of galactic neutral hydrogen to predict the output of the little SRT we have at the university but there's a resolution difference. The data straight from the survey looks like:
And the data from our SRT (I didn't take it, I know it's awful) looks like:
So with some blurring and now successfully having compressed the image to the same resolution, my simulation looks like:
Still obviously some work to go, but it may interest some.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 10 Avr 2015
If you use imresize() to shrink your image, but it is still bigger than the axes on your screen (for example a 500 by 700 image is being shown on 200 by 300 pixels on your screen, then you will not notice any difference upon display, but you will if you look at the actual variable in the variable inspector. Is that what is happening?
See my Zoom demo, attached. Actually it's an adapted demo personally given to me by the imaging team at the Mathworks.
  1 commentaire
Ross Brain
Ross Brain le 11 Avr 2015
I worked out my own mistake. I didn't realise that I could just use imresize on the matrix I was putting into imagesc. For info on what I was trying to do look at my own comment under the question.

Connectez-vous pour commenter.

Plus de réponses (1)

Chris McComb
Chris McComb le 10 Avr 2015
To use imresize, you first read the image in:
a = imread('image.jpg');
Then, you apply imresize as follows (for example to reduce resolution by 50%):
b = imresize(a, 0.5);
Your reduced image is stored to b.
  1 commentaire
Ross Brain
Ross Brain le 11 Avr 2015
My image is stored as an array, which I use imagesc to visualise. This is the image I need to resize so it's not stored anywhere to load in.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by